* [PATCH 1/2] net: Remove redundant null check before kfree in dev.c
@ 2012-11-20 10:57 Sachin Kamat
2012-11-20 20:53 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sachin Kamat @ 2012-11-20 10:57 UTC (permalink / raw)
To: netdev; +Cc: davem, edumazet, sachin.kamat, patches
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(-)
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;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-20 20:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-20 10:57 [PATCH 1/2] net: Remove redundant null check before kfree in dev.c Sachin Kamat
2012-11-20 20:53 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).