xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org,
	"Jürgen Groß" <jgross@suse.com>,
	"David Vrabel" <david.vrabel@citrix.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
	kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 1/3] xen-scsiback: Delete an unnecessary check before the function call "kfree"
Date: Wed, 20 Jul 2016 13:30:50 +0200	[thread overview]
Message-ID: <62e64277-a6bc-9d9d-d80e-f3e515e7bcb3@users.sourceforge.net> (raw)
In-Reply-To: <6863b12b-9095-aaf3-6140-80968e0071e2@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 19 Jul 2016 15:42:19 +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 <elfring@users.sourceforge.net>
---
v2: Rebased on source files from "Linux next-20160719"

 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);
 }
 
-- 
2.9.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-07-20 11:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5307CAA2.8060406@users.sourceforge.net>
     [not found] ` <alpine.DEB.2.02.1402212321410.2043@localhost6.localdomain6>
     [not found]   ` <530A086E.8010901@users.sourceforge.net>
     [not found]     ` <alpine.DEB.2.02.1402231635510.1985@localhost6.localdomain6>
     [not found]       ` <530A72AA.3000601@users.sourceforge.net>
     [not found]         ` <alpine.DEB.2.02.1402240658210.2090@localhost6.localdomain6>
     [not found]           ` <530B5FB6.6010207@users.sourceforge.net>
     [not found]             ` <alpine.DEB.2.10.1402241710370.2074@hadrien>
     [not found]               ` <530C5E18.1020800@users.sourceforge.net>
     [not found]                 ` <alpine.DEB.2.10.1402251014170.2080@hadrien>
     [not found]                   ` <530CD2C4.4050903@users.sourceforge.net>
     [not found]                     ` <alpine.DEB.2.10.1402251840450.7035@hadrien>
     [not found]                       ` <530CF8FF.8080600@users.sourceforge.net>
     [not found]                         ` <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6>
     [not found]                           ` <530DD06F.4090703@users.sourceforge.net>
     [not found]                             ` <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6>
     [not found]                               ` <5317A59D.4@users.sourceforge.net>
2014-11-02 15:12                                 ` [PATCH 1/1] PCI: Deletion of unnecessary checks before three function calls SF Markus Elfring
     [not found]                                 ` <545649DE.80304@users.sourceforge.net>
2014-11-11  4:07                                   ` Bjorn Helgaas
2016-07-16 20:20                                 ` [PATCH 0/3] xen-scsiback: Fine-tuning for scsiback_device_action() SF Markus Elfring
     [not found]                                 ` <59e51c7d-f7bb-c55f-d2fe-06dccfef6a99@users.sourceforge.net>
2016-07-16 20:22                                   ` [PATCH 1/3] xen-scsiback: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2016-07-16 20:23                                   ` [PATCH 2/3] xen-scsiback: One function call less in scsiback_device_action() after error detection SF Markus Elfring
2016-07-16 20:24                                   ` [PATCH 3/3] xen-scsiback: Pass a failure indication as a constant SF Markus Elfring
     [not found]                                   ` <fa839c03-b076-0264-c363-5581d0298632@users.sourceforge.net>
2016-07-18  5:01                                     ` [PATCH 1/3] xen-scsiback: Delete an unnecessary check before the function call "kfree" Juergen Gross
     [not found]                                   ` <e447cf62-ffc7-4b82-cff2-947c8874756a@users.sourceforge.net>
2016-07-18  5:05                                     ` [PATCH 3/3] xen-scsiback: Pass a failure indication as a constant Juergen Gross
     [not found]                                   ` <87e55a72-71ad-d0a1-b936-12565bbc6508@users.sourceforge.net>
2016-07-18  5:11                                     ` [PATCH 2/3] xen-scsiback: One function call less in scsiback_device_action() after error detection Juergen Gross
     [not found]                                     ` <fb5824ad-fb09-e471-7dc4-3e32564cc334@suse.com>
2016-07-19 14:56                                       ` SF Markus Elfring
2016-07-20  4:35                                         ` Juergen Gross
     [not found]                                         ` <83b0b1e2-900b-eefc-160b-7d837730571c@suse.com>
2016-07-20  5:10                                           ` SF Markus Elfring
2016-07-20  5:26                                             ` Juergen Gross
     [not found]                                             ` <85b948e0-bf37-dff0-6792-77b5dacef9a0@suse.com>
2016-07-20 11:27                                               ` [PATCH v2 0/3] xen-scsiback: Fine-tuning for scsiback_device_action() SF Markus Elfring
2016-07-20 11:30                                                 ` SF Markus Elfring [this message]
2016-07-20 11:44                                                   ` [PATCH v2 1/3] xen-scsiback: Delete an unnecessary check before the function call "kfree" Juergen Gross
2016-07-20 11:34                                                 ` [PATCH v2 2/3] xen-scsiback: Rename jump labels in scsiback_device_action() SF Markus Elfring
2016-07-20 11:45                                                   ` Juergen Gross
2016-07-20 11:36                                                 ` [PATCH v2 3/3] xen-scsiback: Pass a failure indication as a constant SF Markus Elfring
2016-07-20 11:44                                                   ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62e64277-a6bc-9d9d-d80e-f3e515e7bcb3@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=jgross@suse.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).