瀏覽代碼

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>
Sachin Kamat 12 年之前
父節點
當前提交
388dfc2d2d
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      net/core/dev.c

+ 2 - 4
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;
 	}