mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
drivers/net: drop redundant memset
The region set by the call to memset is immediately overwritten by the subsequent call to memcpy. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e1,e2,e3,e4; @@ - memset(e1,e2,e3); memcpy(e1,e4,e3); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
255f5c327e
commit
876e956f20
1 changed files with 1 additions and 3 deletions
|
@ -5819,10 +5819,8 @@ static void s2io_vpd_read(struct s2io_nic *nic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) {
|
if ((!fail) && (vpd_data[1] < VPD_STRING_LEN))
|
||||||
memset(nic->product_name, 0, vpd_data[1]);
|
|
||||||
memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);
|
memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);
|
||||||
}
|
|
||||||
kfree(vpd_data);
|
kfree(vpd_data);
|
||||||
swstats->mem_freed += 256;
|
swstats->mem_freed += 256;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue