Message ID | 1353409024-28853-1-git-send-email-sachin.kamat@linaro.org |
---|---|
State | Accepted |
Headers | show |
From: Sachin Kamat <sachin.kamat@linaro.org> Date: Tue, 20 Nov 2012 16:27:04 +0530 > kfree on a null pointer is a no-op. > > Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Applied.
diff --git a/net/core/dev.c b/net/core/dev.c index 83232a1..c380913 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1075,10 +1075,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; }
kfree on a null pointer is a no-op. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> --- net/core/dev.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)