[PATCH] netvsc: fix dereference before null check errors
Haiyang Zhang
haiyangz at microsoft.com
Mon Mar 27 00:50:27 UTC 2017
> -----Original Message-----
> From: Colin King [mailto:colin.king at canonical.com]
> Sent: Saturday, March 25, 2017 10:27 AM
> To: KY Srinivasan <kys at microsoft.com>; Haiyang Zhang
> <haiyangz at microsoft.com>; Stephen Hemminger <sthemmin at microsoft.com>;
> devel at linuxdriverproject.org; netdev at vger.kernel.org
> Cc: kernel-janitors at vger.kernel.org; linux-kernel at vger.kernel.org
> Subject: [PATCH] netvsc: fix dereference before null check errors
>
> From: Colin Ian King <colin.king at canonical.com>
>
> ndev is being checked to see if it is a null pointer however before
> the null check ndev is being dereferenced; hence there is a potential
> null pointer dereference bug that needs fixing. Fix this by only
> dereferencing ndev after the null check.
>
> Detected by CoverityScan, CID#1420760, CID#140761 ("Dereference
> before null check")
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
Reviewed-by: Haiyang Zhang <haiyangz at microsoft.com>
Thank you!
More information about the devel
mailing list