From patchwork Sat Jul 16 20:22:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9233377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1F53B60865 for ; Sat, 16 Jul 2016 20:24:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10CC5212D8 for ; Sat, 16 Jul 2016 20:24:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03DCF212DB; Sat, 16 Jul 2016 20:24:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8E283212D8 for ; Sat, 16 Jul 2016 20:24:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOW6e-0007mk-Rp; Sat, 16 Jul 2016 20:22:36 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOW6d-0007me-T5 for xen-devel@lists.xenproject.org; Sat, 16 Jul 2016 20:22:35 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id DB/E8-05127-B879A875; Sat, 16 Jul 2016 20:22:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRWlGSWpSXmKPExsVy0+OAn27X9K5 wg7+rFCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxD73cyFbxkq1h0uZepgfEbaxcjF4eQwHxG ic6zj1i6GDk5hAUSJKYdW8gCkhAROM0osfvDY2aIqj9sEluXHWcCqWIWyJOYe+AZO4jNJmAu0 bv2M1g3r4CHxNtLl8HiLAKqEp0zJ4LZogKhEivenGCDqBGUODnzCVg9p4CnxNw7DxghZqpL/J l3iRnClpfY/nYO2GIJgc+MEnub9rNBOH3sEtPfPGScwMg/C8mwWUgGzEIyYAEj8ypG9eLUorL UIl1TvaSizPSMktzEzBxdQwNTvdzU4uLE9NScxKRiveT83E2MwGBkAIIdjF/6nQ8xSnIwKYny fj/aGS7El5SfUpmRWJwRX1Sak1p8iFGGg0NJgvf71K5wIcGi1PTUirTMHGBcwKQlOHiURCDSv MUFibnFmekQqVOMuhwLftxeyyTEkpeflyolzisyDahIAKQoozQPbgQsRi8xykoJ8zICHSXEU5 BalJtZgir/ilGcg1FJmPc3yCqezLwSuE2vgI5gAjrC2rwd5IiSRISUVAPjDM1Xq3pmT3aJaNx wrOGCnEHlhtY9ut069x2+rGAW+j4pPXTfzlTrV7Y3pZer8Xywu7V87p2fvJJVHj87o3zFI6O0 n7b+X6PxcIPury+1nZmGHFnrjNR9TlWkPMvts8mL8ttzeIroWuU/ConHY3u00gz+7WR4o1bL/ umOoaWd6VvVyn+H6lqUWIozEg21mIuKEwEPwZjvzAIAAA== X-Env-Sender: elfring@users.sourceforge.net X-Msg-Ref: server-16.tower-206.messagelabs.com!1468700554!34031466!1 X-Originating-IP: [217.72.192.78] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17774 invoked from network); 16 Jul 2016 20:22:34 -0000 Received: from mout.web.de (HELO mout.web.de) (217.72.192.78) by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 16 Jul 2016 20:22:34 -0000 Received: from [192.168.1.2] ([77.182.189.163]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0M5fsK-1b92Yn3J6m-00xf8l; Sat, 16 Jul 2016 22:22:29 +0200 To: xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org, =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= , David Vrabel , Boris Ostrovsky References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <59e51c7d-f7bb-c55f-d2fe-06dccfef6a99@users.sourceforge.net> From: SF Markus Elfring Message-ID: Date: Sat, 16 Jul 2016 22:22:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <59e51c7d-f7bb-c55f-d2fe-06dccfef6a99@users.sourceforge.net> X-Provags-ID: V03:K0:EbYy4fCF/GbyHtZDNV+23j7Z2gU+iuOjfjOf6Ql+qiOD1bquWsp QW/uMI5zSMiMJGIlqNgUQAbPTAcWaUxTRTyEkb5nhYYKIWNTq6dPvUKHPIZU3BnIR/sd29h NQ8q/09dFaTVTJdU5oyPwdnK7yHdPR2KVzUb0KKKVLo+SXAZMXYpPgxxkjKeUxQeCyiJDfk 2ZjG2qqUUvzgveagXUDuA== X-UI-Out-Filterresults: notjunk:1; V01:K0:/dFBsphdOU4=:GM5g8kbK8HrYfiK+SVzeAP 0Lj41LXeV8PMbqFML9srB0jVr+/VOLMXG3ARILRT0wkAn/XLfZVX5VgTtMgjyUs66g2XK7RiD KADr4bTcwu/jm32tboxGd1NLzyEQXQIDpkEMo8pLgqgdGSNntq1kf7Y7Q/IzpRKfeGTFf25S9 nt4ROpfr9L6vNj6NgQ9qL48hA89DqG0gECHZlfPcYjZluisOkPp4huNAm29qmBZbmcA8Zr9ET bF1yCCr8OO8ZYSn4YZ1Rf/FVbuvOpAhz/Q1C9AJp4IMUkpF1omTQtoCh/K1o2EalvBAJIDbJx klAO/nR/mDBOp4yuDUkUg6P11dq6CyynOAC9d9bYROeCOcFBG4+SDqh2KI1zfRS5TepAQ2bjv ZTS1+zjLGirBGjGPfvP4YdXaw0wR9FFSPkLf7TAo3zsF8HvB3r/n5hDeFKm513im8j78GkXBS hjpmWdgd010b1+nzh1xZTZfxwLn2DozWLED7FahGrd1mYbEBI+CIC42WmS0fskXIRWN5Ko00L CrApi2sdBd12+BowcK7pz+ftk22qkZ69YiNLFTa6mTXGaYdOgUYG7NueX2fA1+B+sWcTWoULL +sDI9pdy1M8iUSP6aviuueofcvWbaNwDQsF+m5GWj16eCp/ZvFb1SXYiveUf2Xfc/ZoU/vKia NHEHmjodumFFf2HgbWaYwbU3apCETl3jsH2LSQIrxY/kWSGLGPlnLbJp2a178BbF0vM8yrUfH c7kwFdpTQEvzLqVrW2sMqJGI73kwISgX8uIA9qZFFHRIcXd4eCsZAki/GdVdgWahdVGhM4Taf r4aubXd Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML Subject: [Xen-devel] [PATCH 1/3] xen-scsiback: Delete an unnecessary check before the function call "kfree" X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 16 Jul 2016 21:21:05 +0200 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Juergen Gross --- drivers/xen/xen-scsiback.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index d6950e0..4a48c06 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -627,8 +627,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req, transport_generic_free_cmd(&pending_req->se_cmd, 1); return; err: - if (tmr) - kfree(tmr); + kfree(tmr); scsiback_do_resp_with_sense(NULL, err, 0, pending_req); }