mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
net: Remove redundant null check before kfree in dev.c
kfree on a null pointer is a no-op. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
973b1b9a45
commit
388dfc2d2d
1 changed files with 2 additions and 4 deletions
|
@ -1153,10 +1153,8 @@ int dev_set_alias(struct net_device *dev, const char *alias, size_t len)
|
|||
return -EINVAL;
|
||||
|
||||
if (!len) {
|
||||
if (dev->ifalias) {
|
||||
kfree(dev->ifalias);
|
||||
dev->ifalias = NULL;
|
||||
}
|
||||
kfree(dev->ifalias);
|
||||
dev->ifalias = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue