mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.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: hisi_sas: Add a missing call to kfree
Date: Mon, 21 Nov 2016 12:53:43 +0000	[thread overview]
Message-ID: <e1e060ba-a231-b4f3-4a41-f9fac9ca2d54@huawei.com> (raw)
In-Reply-To: <20161119174259.20344-1-lambert.quentin@gmail.com>

On 19/11/2016 17:42, Quentin Lambert wrote:
> Most error branches following the call to hisi_sas_shost_alloc contain
> a call to kfree. This patch add these calls where they are
> missing.
>
> This issue was found with Hector.

I think that this patch is fine. However I have noticed that we should 
do a call to hisi_sas_free() for this failure, and later failures in the 
probe.

I can generate a patch for this.

Cheers,
John

>
> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
>
> ---
>  drivers/scsi/hisi_sas/hisi_sas_main.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> --- a/drivers/scsi/hisi_sas/hisi_sas_main.c
> +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
> @@ -1503,8 +1503,10 @@ int hisi_sas_probe(struct platform_devic
>
>  	arr_phy = devm_kcalloc(dev, phy_nr, sizeof(void *), GFP_KERNEL);
>  	arr_port = devm_kcalloc(dev, port_nr, sizeof(void *), GFP_KERNEL);
> -	if (!arr_phy || !arr_port)
> -		return -ENOMEM;
> +	if (!arr_phy || !arr_port) {
> +		rc = -ENOMEM;
> +		goto err_out_ha;
> +	}
>
>  	sha->sas_phy = arr_phy;
>  	sha->sas_port = arr_port;
>
> .
>

  reply	other threads:[~2016-11-21 12:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-19 17:42 Quentin Lambert
2016-11-21 12:53 ` John Garry [this message]
2016-11-21 13:20   ` Quentin Lambert
2016-11-21 14:16     ` John Garry
2016-11-21 14:25       ` Quentin Lambert
2016-11-21 14:32         ` John Garry

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=e1e060ba-a231-b4f3-4a41-f9fac9ca2d54@huawei.com \
    --to=john.garry@huawei.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®