Re: [PATCH][net-next] net: hinic: fix null pointer dereference on pointer hwdev

From: Sergei Shtylyov
Date: Thu Nov 22 2018 - 04:22:53 EST


Hello!

On 21.11.2018 22:59, Colin King wrote:

From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

Pointer hwdev is being dereferenced when declaring hwif , however, later
on hwdev is being null checked, hence we have dereference before null
check error. Fix this by assigning hwiw and pdef only once hwdev has

It's hwif, right?

been null checked.

Detected by CoverityScan, CID#1485581 ("Dereference before null check")

Fixes: 4a61abb100c8 ("net-next/hinic:add rx checksum offload for HiNIC")


No need for this empty line.

Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
[...]

MBR, Sergei