提交 8910b49f 编写于 作者: M Micah Gruber 提交者: 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: NJeff Garzik <jeff@garzik.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册