All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jing Xiangfeng <jingxiangfeng@huawei.com>
To: Markus Elfring <Markus.Elfring@web.de>, linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hannes Reinecke <hare@suse.de>,
	"James E. J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Neerav Parikh <Neerav.Parikh@intel.com>,
	Robert Love <robert.w.love@intel.com>
Subject: Re: [PATCH] scsi: fcoe: add missed kfree() in an error path
Date: Thu, 09 Jul 2020 02:11:38 +0000	[thread overview]
Message-ID: <5F067CDA.8010404@huawei.com> (raw)
In-Reply-To: <977e2781-99ed-54c0-27ad-82d768a1c1e6@web.de>



On 2020/7/7 19:38, Markus Elfring wrote:
>> fcoe_fdmi_info() misses to call kfree() in an error path.
>> Add the missed function call to fix it.
>
> I suggest to use an additional jump target for the completion
> of the desired exception handling.
>
>
> …
>> +++ b/drivers/scsi/fcoe/fcoe.c
>> @@ -830,6 +830,7 @@ static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev)
>>   		if (rc) {
>>   			printk(KERN_INFO "fcoe: Failed to retrieve FDMI "
>>   					"information from netdev.\n");
>> +			kfree(fdmi);
>>   			return;
>>   		}
>
> -			return;
> +			goto free_fdmi;
>
>
> How do you think about to apply any further coding style adjustments?

The local variable "fdmi" is invisible to the function.
See fcoe_fdmi_info().

	Thanks
>
> Regards,
> Markus
> .
>

WARNING: multiple messages have this Message-ID (diff)
From: Jing Xiangfeng <jingxiangfeng@huawei.com>
To: Markus Elfring <Markus.Elfring@web.de>, <linux-scsi@vger.kernel.org>
Cc: <kernel-janitors@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Hannes Reinecke" <hare@suse.de>,
	"James E. J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Neerav Parikh <Neerav.Parikh@intel.com>,
	Robert Love <robert.w.love@intel.com>
Subject: Re: [PATCH] scsi: fcoe: add missed kfree() in an error path
Date: Thu, 9 Jul 2020 10:11:38 +0800	[thread overview]
Message-ID: <5F067CDA.8010404@huawei.com> (raw)
In-Reply-To: <977e2781-99ed-54c0-27ad-82d768a1c1e6@web.de>



On 2020/7/7 19:38, Markus Elfring wrote:
>> fcoe_fdmi_info() misses to call kfree() in an error path.
>> Add the missed function call to fix it.
>
> I suggest to use an additional jump target for the completion
> of the desired exception handling.
>
>
> …
>> +++ b/drivers/scsi/fcoe/fcoe.c
>> @@ -830,6 +830,7 @@ static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev)
>>   		if (rc) {
>>   			printk(KERN_INFO "fcoe: Failed to retrieve FDMI "
>>   					"information from netdev.\n");
>> +			kfree(fdmi);
>>   			return;
>>   		}
>
> -			return;
> +			goto free_fdmi;
>
>
> How do you think about to apply any further coding style adjustments?

The local variable "fdmi" is invisible to the function.
See fcoe_fdmi_info().

	Thanks
>
> Regards,
> Markus
> .
>

  reply	other threads:[~2020-07-09  2:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 11:38 [PATCH] scsi: fcoe: add missed kfree() in an error path Markus Elfring
2020-07-07 11:38 ` Markus Elfring
2020-07-09  2:11 ` Jing Xiangfeng [this message]
2020-07-09  2:11   ` Jing Xiangfeng
2020-07-09  7:22   ` Markus Elfring
2020-07-09  7:22     ` Markus Elfring
2020-07-09 11:08     ` Jing Xiangfeng
2020-07-09 11:08       ` Jing Xiangfeng
  -- strict thread matches above, loose matches on Subject: below --
2020-07-07 10:24 Jing Xiangfeng

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=5F067CDA.8010404@huawei.com \
    --to=jingxiangfeng@huawei.com \
    --cc=Markus.Elfring@web.de \
    --cc=Neerav.Parikh@intel.com \
    --cc=hare@suse.de \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=robert.w.love@intel.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 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.