From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: Karen Xie <kxie@chelsio.com>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][V3] scsi: cxgbi: remove redundant __kfree_skb call on skb and free cst->atid
Date: Sat, 13 Apr 2019 00:06:01 +0000 [thread overview]
Message-ID: <yq1k1fykbva.fsf@oracle.com> (raw)
In-Reply-To: <20190412083301.25503-1-colin.king@canonical.com> (Colin King's message of "Fri, 12 Apr 2019 09:33:01 +0100")
Colin,
> The error return path via label rel_resource checks for a non-null skb
> before free'ing it. However, skb is always null at this exit path, so
> the null check and the free are redundant and can be removed.
> Removing this allows the original goto's to rel_resource to be cleaned
> up; the first can be replaced by a return of -EINVAL, the second can
> be replaced by a more appropriate -ENOMEM return and fix a memory leak
> by freeing csk->atid.
Applied to 5.2/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
WARNING: multiple messages have this Message-ID (diff)
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: Karen Xie <kxie@chelsio.com>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][V3] scsi: cxgbi: remove redundant __kfree_skb call on skb and free cst->atid
Date: Fri, 12 Apr 2019 20:06:01 -0400 [thread overview]
Message-ID: <yq1k1fykbva.fsf@oracle.com> (raw)
In-Reply-To: <20190412083301.25503-1-colin.king@canonical.com> (Colin King's message of "Fri, 12 Apr 2019 09:33:01 +0100")
Colin,
> The error return path via label rel_resource checks for a non-null skb
> before free'ing it. However, skb is always null at this exit path, so
> the null check and the free are redundant and can be removed.
> Removing this allows the original goto's to rel_resource to be cleaned
> up; the first can be replaced by a return of -EINVAL, the second can
> be replaced by a more appropriate -ENOMEM return and fix a memory leak
> by freeing csk->atid.
Applied to 5.2/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2019-04-13 0:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 8:33 [PATCH][V3] scsi: cxgbi: remove redundant __kfree_skb call on skb and free cst->atid Colin King
2019-04-12 8:33 ` Colin King
2019-04-12 13:41 ` Dan Carpenter
2019-04-12 13:41 ` Dan Carpenter
2019-04-13 0:06 ` Martin K. Petersen [this message]
2019-04-13 0:06 ` Martin K. Petersen
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=yq1k1fykbva.fsf@oracle.com \
--to=martin.petersen@oracle.com \
--cc=colin.king@canonical.com \
--cc=jejb@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kxie@chelsio.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.