Re: [PATCH] mm, vmpressure: Fix a signedness bug in vmpressure_register_event()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 28, 2019 at 02:23:56PM -0700, Andrew Morton wrote:
> How about doing it this way?  Only copy the int to the enum once we
> know it's within range?

This will return a positive integer on success instead of 0.  We need:

 	mutex_unlock(&vmpr->events_lock);
+	ret = 0;
 out:

with that,

Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>

How about further adding ...

+ * Return: 0 on success, -ENOMEM on memory failure or -EINVAL if @args could
+ * not be parsed.



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux