From patchwork Tue Nov 20 10:57:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12982 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 74BC323E01 for ; Tue, 20 Nov 2012 11:03:20 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1EB88A18FA6 for ; Tue, 20 Nov 2012 11:03:20 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so1619770iag.11 for ; Tue, 20 Nov 2012 03:03:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=wXsbfNMxxwP+GVLNllFzdreztRulUUDtj0d/h2e9KjQ=; b=Z7fjB9rVmpJl8XxabhGYl3PoVXNBbWAgQYnRcx/BQt53qAl1GwFWgohIRwzbHj4ipX EWeVgCXAHzIKc9BnAQzrbwRctYQPsVWXbMuAz6yhuHEJVGohnUBj+A7hAgjN7jXE8ZSo zmcncj728vXCf93hQWzvMyCjPDAl71H4UPIr0y5vMYLd0Qg0NyR7FjsGj/uFSXswzUvg 1TFbSMSRRmcsuttqsCnM5s+TdD+y2bjg0fi5KFpaSUFrBkz5akeFZ1MRfjVkN/RI7Zc2 FNWxF3tQQf4Jv5rHmaBlcVTTLgqLPBCl5C+h2mne8PTKAYOSgzpn489ia9IIWdaTWNv5 wcdg== Received: by 10.50.213.69 with SMTP id nq5mr9468601igc.70.1353409399566; Tue, 20 Nov 2012 03:03:19 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp300607igt; Tue, 20 Nov 2012 03:03:18 -0800 (PST) Received: by 10.66.84.132 with SMTP id z4mr6940069pay.63.1353409397953; Tue, 20 Nov 2012 03:03:17 -0800 (PST) Received: from mail-da0-f53.google.com (mail-da0-f53.google.com [209.85.210.53]) by mx.google.com with ESMTPS id a6si17456267paw.302.2012.11.20.03.03.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 03:03:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.53 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.53; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.53 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-da0-f53.google.com with SMTP id x6so151926dac.26 for ; Tue, 20 Nov 2012 03:03:17 -0800 (PST) Received: by 10.66.85.10 with SMTP id d10mr6930127paz.52.1353409397575; Tue, 20 Nov 2012 03:03:17 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ni8sm7901232pbc.70.2012.11.20.03.03.14 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 03:03:16 -0800 (PST) From: Sachin Kamat To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/2] net: Remove redundant null check before kfree in dev.c Date: Tue, 20 Nov 2012 16:27:04 +0530 Message-Id: <1353409024-28853-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQl031DCxMqXWNoh3CqmC4625hVsxehZhSnzW+4zdve3IrDxzHBlHNoRvaQvYNvrd5sYZJhb kfree on a null pointer is a no-op. Signed-off-by: Sachin Kamat --- 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; }