[PATCH] nvmet-auth: Fix unsigned comparison with less than zero
Chaitanya Kulkarni
chaitanyak at nvidia.com
Tue Jul 19 00:09:43 PDT 2022
On 7/19/22 00:00, Jiapeng Chong wrote:
> The return from the call to nvmet_auth_challenge() and nvmet_setup_auth()
> is int, it can be a negative error code, however this is being assigned
> to an u16 variable 'status', so making 'status' an int, and change the
> position to keep the code format.
>
> This was found by coccicheck:
>
> ./drivers/nvme/target/fabrics-cmd-auth.c:488:6-12: WARNING: Unsigned expression compared with zero: status < 0.
> ./drivers/nvme/target/fabrics-cmd-auth.c:251:8-14: WARNING: Unsigned expression compared with zero: status < 0.
>
> Reported-by: Abaci Robot <abaci at linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong at linux.alibaba.com>
> ---
I've already sent out the fix and it is been reviewed-by author of
the code.
-ck
More information about the Linux-nvme
mailing list