Staging: hv: netvsc: Fix a dereferencing issue

net_dev is being de-referenced without proper checking; fix it.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
K. Y. Srinivasan 2011-10-06 10:10:56 -07:00 committed by Greg Kroah-Hartman
parent 92ae4ebdaa
commit 715a4801e7

View File

@ -368,11 +368,11 @@ int rndis_filter_receive(struct hv_device *dev,
struct rndis_message *rndis_hdr;
struct net_device *ndev;
ndev = net_dev->ndev;
if (!net_dev)
return -EINVAL;
ndev = net_dev->ndev;
/* Make sure the rndis device state is initialized */
if (!net_dev->extension) {
netdev_err(ndev, "got rndis message but no rndis device - "