From: Tomas Henzl <thenzl@redhat.com>
To: Quentin Lambert <lambert.quentin@gmail.com>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] scsi: aic94xx: Add a missing call to kfree
Date: Tue, 22 Nov 2016 16:51:25 +0100 [thread overview]
Message-ID: <a98c4b93-2e49-0d99-18dd-ac00446f3ca7@redhat.com> (raw)
In-Reply-To: <20161119174038.20083-1-lambert.quentin@gmail.com>
On 19.11.2016 18:40, Quentin Lambert wrote:
> Most error branches following the call to kzalloc contain
> a call to kfree. This patch add these calls where they are
> missing.
>
> This issue was found with Hector.
Hi Quentin,
most error branches also do set the freed pointer to NULL,
please do the same.
tomash
> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
>
> ---
> drivers/scsi/aic94xx/aic94xx_hwi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/scsi/aic94xx/aic94xx_hwi.c
> +++ b/drivers/scsi/aic94xx/aic94xx_hwi.c
> @@ -228,8 +228,10 @@ static int asd_init_scbs(struct asd_ha_s
> bitmap_bytes = (asd_ha->seq.tc_index_bitmap_bits+7)/8;
> bitmap_bytes = BITS_TO_LONGS(bitmap_bytes*8)*sizeof(unsigned long);
> asd_ha->seq.tc_index_bitmap = kzalloc(bitmap_bytes, GFP_KERNEL);
> - if (!asd_ha->seq.tc_index_bitmap)
> + if (!asd_ha->seq.tc_index_bitmap) {
> + kfree(asd_ha->seq.tc_index_array);
> return -ENOMEM;
> + }
>
> spin_lock_init(&seq->tc_index_lock);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2016-11-22 15:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-19 17:40 Quentin Lambert
2016-11-22 15:51 ` Tomas Henzl [this message]
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=a98c4b93-2e49-0d99-18dd-ac00446f3ca7@redhat.com \
--to=thenzl@redhat.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lambert.quentin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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
all inboxes | Powered by JetHome®