summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-11-20 01:57:04 +0100
committerDavid S. Miller <davem@davemloft.net>2012-11-20 19:48:09 +0100
commit388dfc2d2d9c43c251921a397d6fe5ef7dc34731 (patch)
tree7a6c81d21ee830781c933a3170f86ee222b64bca /net
parentcaif: Remove redundant null check before kfree in cfctrl.c (diff)
downloadlinux-388dfc2d2d9c43c251921a397d6fe5ef7dc34731.tar.xz
linux-388dfc2d2d9c43c251921a397d6fe5ef7dc34731.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 0afae8ba413e..7304ea8a1f13 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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;
}