Commit 8910b49f authored by Micah Gruber's avatar Micah Gruber Committed by Jeff Garzik

Fix a potential NULL pointer dereference in free_shared_mem() in drivers/net/s2io.c

This patch fixes a potential null dereference bug where we dereference
nic before a null check. This patch simply moves the dereferencing
after the null check.

Signed-off-by: Micah Gruber < micah.gruber@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 4c75f741
......@@ -796,12 +796,14 @@ static void free_shared_mem(struct s2io_nic *nic)
struct mac_info *mac_control;
struct config_param *config;
int lst_size, lst_per_page;
struct net_device *dev = nic->dev;
struct net_device *dev;
int page_num = 0;
if (!nic)
return;
dev = nic->dev;
mac_control = &nic->mac_control;
config = &nic->config;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment