From patchwork Wed Nov 21 05:59:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13024 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 F267523E13 for ; Wed, 21 Nov 2012 06:05:51 +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 97EE7A19BD6 for ; Wed, 21 Nov 2012 06:05:51 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so2273082iag.11 for ; Tue, 20 Nov 2012 22:05:51 -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=mz21ANqjoNi6GkDjNr8SqG7mbgkc10MMiL46Jg6op54=; b=GbEPAZ+jOs9LcpGwl6YzTIwjkslRDHOiKbJ0i1u5spc4xF/FcreEkCrv2ycd8VqdGn 0QUGRykoLxDdAPW0uoCe+DlR5fB/hpB4QI2vRgKvFAtK5WuN6u8rMisqzr0esmDsO085 oKS24W9iAZAKQCFbdMtC5SBR7Bg8lGL+6gEJ3vkMujwMo80YtJponCi1jbjRp4UKl2lE BpAi6SC21928mQFTr70Rit29erWAZJeFlVlaotI8thrnRncp9SsG2pbcb9v7pR1pLMJ2 dramS/SnaIw7PW04cKrLPYlttyF3j7Fab+pJL7jf9cOtO0jzkCgH5NXXgKUWYEUb/pki y7PQ== Received: by 10.50.91.195 with SMTP id cg3mr12566923igb.57.1353477950885; Tue, 20 Nov 2012 22:05:50 -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 n20csp438253igt; Tue, 20 Nov 2012 22:05:50 -0800 (PST) Received: by 10.66.87.202 with SMTP id ba10mr14918402pab.72.1353477949968; Tue, 20 Nov 2012 22:05:49 -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 bf10si20969199pab.195.2012.11.20.22.05.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 22:05:49 -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 x6so485922dac.40 for ; Tue, 20 Nov 2012 22:05:49 -0800 (PST) Received: by 10.68.219.164 with SMTP id pp4mr50305737pbc.72.1353477949287; Tue, 20 Nov 2012 22:05:49 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id nv2sm9346647pbc.44.2012.11.20.22.05.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 22:05:48 -0800 (PST) From: Sachin Kamat To: devel@driverdev.osuosl.org Cc: gregkh@linuxfoundation.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] staging: gdm72xx: Remove redundant null check before kfree in gdm_wimax.c Date: Wed, 21 Nov 2012 11:29:36 +0530 Message-Id: <1353477576-26451-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlSQEImdUw+kmqPrmCaWfa5H8MYRwEVIE9/v55IyCSE4/0NbeNiquSLV5A8CGYl1pwcCiTA kfree on a null pointer is a no-op. Signed-off-by: Sachin Kamat --- drivers/staging/gdm72xx/gdm_wimax.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index c302769..ea5accd 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -535,10 +535,8 @@ static int gdm_wimax_close(struct net_device *dev) static void kdelete(void **buf) { - if (buf && *buf) { - kfree(*buf); - *buf = NULL; - } + kfree(*buf); + *buf = NULL; } static int gdm_wimax_ioctl_get_data(struct data_s *dst, struct data_s *src)