From patchwork Tue Nov 20 11:40:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12984 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 41B2D23FC0 for ; Tue, 20 Nov 2012 11:46:24 +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 D45BAA182AD for ; Tue, 20 Nov 2012 11:46:23 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so1639056iag.11 for ; Tue, 20 Nov 2012 03:46:23 -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=gpFlaEIKNY8ermPlBaqdV0p8wdQYMA7iE8YNZZ/rpUQ=; b=AR7hJ37+BDpoqq9K9pXrMDIC7XZTx0HsyLh50QDXOn1OfKeZdCK0t5jvdsyS2SNhno xVMRdFBCpSC+ggF8HdUctqa/ugW4XNs0W4SigtqYp4OupcylcdtL3ej7gWiz5PsMBz9z XmRhUqfHONP22BuBIT0Z9raEqzEbTUaInLPX9S0vjasvacdTYQ7oMS/OfaxGsgs9fLbd 5/zFXDvK1SWPq3Ay9p75uKVerqnQxwWh74E6fKc+gzJSl1ycT697QfdeGiQAXgxCaa+o X5AylLxMAhECZKTrEhOsdkd1qWmI3g5+8fgXWMBzRaSvT4iFPQBCZNCxpDsHYQxZ3JVS ZXrQ== Received: by 10.50.213.34 with SMTP id np2mr9645776igc.57.1353411983321; Tue, 20 Nov 2012 03:46:23 -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 n20csp304882igt; Tue, 20 Nov 2012 03:46:22 -0800 (PST) Received: by 10.66.84.131 with SMTP id z3mr7193658pay.34.1353411981591; Tue, 20 Nov 2012 03:46:21 -0800 (PST) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by mx.google.com with ESMTPS id ux7si18022851pbc.132.2012.11.20.03.46.21 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 03:46:21 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.52 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-pb0-f52.google.com with SMTP id ro2so4010676pbb.11 for ; Tue, 20 Nov 2012 03:46:21 -0800 (PST) Received: by 10.66.84.163 with SMTP id a3mr7209462paz.2.1353411981364; Tue, 20 Nov 2012 03:46:21 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id bc8sm7968823pab.5.2012.11.20.03.46.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 03:46:20 -0800 (PST) From: Sachin Kamat To: devel@driverdev.osuosl.org Cc: rgujare@ozmodevices.com, ckelly@ozmodevices.com, gregkh@linuxfoundation.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c Date: Tue, 20 Nov 2012 17:10:08 +0530 Message-Id: <1353411610-3401-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQn2UCEXVXAmMaROf8KKXH4lW0DVnw01viNvGPIqRDp2UiH7ys1eIbniVeZYvb9fgZAGMueh kfree on NULL pointer is a no-op. Signed-off-by: Sachin Kamat --- drivers/staging/ozwpan/ozpd.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c index 0b3648c..118a4db 100644 --- a/drivers/staging/ozwpan/ozpd.c +++ b/drivers/staging/ozwpan/ozpd.c @@ -402,8 +402,7 @@ static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f) f = 0; } spin_unlock_bh(&pd->tx_frame_lock); - if (f) - kfree(f); + kfree(f); } /*------------------------------------------------------------------------------ * Context: softirq-serialized @@ -737,8 +736,7 @@ int oz_isoc_stream_create(struct oz_pd *pd, u8 ep_num) st = 0; } spin_unlock_bh(&pd->stream_lock); - if (st) - kfree(st); + kfree(st); return 0; } /*------------------------------------------------------------------------------