On Fri, Oct 02, 2026 at 07:56:41PM +0300, Serhat Kumral wrote:
> When nvdimm_clear_poison() fails, it returns a negative error code.
> However, 'cleared' is a signed long while 'size' is size_t.
> The comparison 'cleared < size' promotes 'cleared' to an unsigned long.
> So the error condition can be bypassed and the function can
> incorrectly return success if the subsequent flush succeeds.
> 
> Explicitly check for negative error codes before comparing with 'size'.

The fix looks good to me. Thanks for addressing this.

Reviewed-by: Alison Schofield <[email protected]>


Reply via email to