Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2624876ybi; Thu, 18 Jul 2019 11:23:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqygzlojPRP0pVFQdPBFt+8+8zeGjDNAzW1P7sXdRPLRv+BjuIcYrxDQUJKyG3F9xjAP73uC X-Received: by 2002:a63:ee08:: with SMTP id e8mr24910009pgi.70.1563474230817; Thu, 18 Jul 2019 11:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563474230; cv=none; d=google.com; s=arc-20160816; b=qjq2c1EOcPs9KMc8iHWj6uwHdryK7c9nUj09uKMixq2pyq+ij0HzHuE2k5XKr+NGtH gB2n4lmUOz7hWBIJpLvyIsWznGf/GqG1Ir0DBwyXT8WXi7tUKg8RdAZzFICw9JSJy1T2 JZmewR3ArH8qB9Wp4Kw4/7PlRYkAXF1AiJ0p/BeiPeffZiKUV7H7Cl9lDMguEZcEdFSt bUibwPXkJc+4JetFDFrwSoLCUmpwiAe9fB4dhDBlWjYh9Q80dsLElmDQ6F6aX/2Ui6OA 1IIKHiPtjOPlO61EVSb1dCkrxCf/r7g319yP+ocazRoQZr9dVw8LJli17AIsq5p0Newd +TPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=NfeU7C+4cQYfAuh2am+KuzQ3c0bYfoeWeqp96pcMW98=; b=dl2X4/FuM13cOWF3Oj2GVjsYu0fnLj4pqHuQ2KQxVeU5prvcN13HYmMcl9eGFjRoPm sW8nc/7gdV10Nm7aYdsQsser2V8P3oG41c0zMZiJeFQtXXdLQyZuyqe3knXw5bBejJjA 5fP6KGSLZcJJxu5HF6AWLlv9bzbtek0tDD0QbxwSr6htf7KnLqJQahCK4gD/YKzhwIJe mReB7U6h2nAkYrp8L3PgXIqO7lpZFHgdUedkq1yRwsfwaCpj8lwzRDLUQmoKKQGfpJTS Xw0PtimZ5GTXSkXyt8DjrNtrvP9+C4SZlwcIzEgB11dU8JrnZhd7IuyJ9ZOlVJDbMyVT uKVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AOso9T90; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22si2999800pjn.55.2019.07.18.11.23.34; Thu, 18 Jul 2019 11:23:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AOso9T90; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728183AbfGRSXB (ORCPT + 99 others); Thu, 18 Jul 2019 14:23:01 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39050 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726649AbfGRSXB (ORCPT ); Thu, 18 Jul 2019 14:23:01 -0400 Received: by mail-pg1-f193.google.com with SMTP id u17so13258626pgi.6 for ; Thu, 18 Jul 2019 11:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=NfeU7C+4cQYfAuh2am+KuzQ3c0bYfoeWeqp96pcMW98=; b=AOso9T90+nC8FC7UpIKhHVQNz/XM9XiXEx3kny7xcy3c0FhyOB/ZkcjLeiEC6QnMEy MQuSLHlhIpCTGc3NzkFU5FoqEsR5QGxFrKSygOfnkPDVgrot0bWeJKJbxO4xTKWpca/0 srDMPgL6ACS+cNYSNeRph5lGocRvlP4LMfdbvpeXqzvriNg7XRSimJZf7ITwJnAtKRih pPOVo846YmHDQnttO5KHw46sfT2Q0FuO3K1q0luJ7JhLgEJb5x+6TcdVF3hLGzFCSUI+ EMxTQYFPbn2kxYPW/dHBUjnutwYlKdvYA6ymcB6tdmNkNe7Gt6Ukmwz11nP5NZKbeD+k yr3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=NfeU7C+4cQYfAuh2am+KuzQ3c0bYfoeWeqp96pcMW98=; b=ld63Quzbq01ve/QTRpp0JMbLrHqQasW4dqnrzFlTKt+pRkQLr0sScWZWTNWBaheknv Qg0dJkel50UxMuiniOTARqQSrrAxJXuCQyxheY4FvHwCL8tXo1TmO8QQeXkOp87PE4h5 BOM4xtLAMbgl1hZXYtvykwByOg3rsrp5KMXi3s1aJTuhNcr/bLS0aASFCF88uZkrEE+D 1pkup7inYq2Q8qsY5IbcZH38FTl+gXS8MU5dPrHeNSQMZixT4dWc3J17duSf7Fs0TYw/ CYa0t1kGOm5N0/Jm3eR0oOPzVHKsIWT9/uHuwg7HaJZPOYQOi6WHV6MzUb9jF2qhBb+8 BwlA== X-Gm-Message-State: APjAAAXC+/oyyxHFrh4Qm3jPZyX6iAmnn2Nhr9DDy7nI+G/hhBt12kHM 4D1N1mqcoTwYSXL20teMRko= X-Received: by 2002:a65:5144:: with SMTP id g4mr49111581pgq.202.1563474180700; Thu, 18 Jul 2019 11:23:00 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.86.126]) by smtp.gmail.com with ESMTPSA id k8sm28351747pgm.14.2019.07.18.11.22.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jul 2019 11:22:57 -0700 (PDT) Date: Thu, 18 Jul 2019 23:52:50 +0530 From: Hariprasad Kelam To: Greg Kroah-Hartman , Geordan Neukum , Dan Carpenter , Michael Scheiderer , Fabian Krueger , Simon =?iso-8859-1?Q?Sandstr=F6m?= , Jeremy Sowden , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: kpc2000: Remove null check before kfree Message-ID: <20190718182250.GA3011@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As kfree already has NULL check we may not need null check before calling same. Issue found with coccicheck Signed-off-by: Hariprasad Kelam --- drivers/staging/kpc2000/kpc2000_spi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 35ac1d7..c07d2fc 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -411,9 +411,7 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m) kp_spi_cleanup(struct spi_device *spidev) { struct kp_spi_controller_state *cs = spidev->controller_state; - - if (cs) - kfree(cs); + kfree(cs); } /****************** -- 2.7.4