All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Hannes Reinecke <hare@suse.de>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/4] iscsi class: fix get_host_stats error handling
Date: Thu, 31 Jul 2014 17:32:21 -0500	[thread overview]
Message-ID: <53DAC3F5.5070108@cs.wisc.edu> (raw)
In-Reply-To: <53D8EA2F.8040505@suse.de>

On 07/30/2014 07:50 AM, Hannes Reinecke wrote:
> On 07/12/2014 10:51 PM, michaelc@cs.wisc.edu wrote:
>> From: Mike Christie <michaelc@cs.wisc.edu>
>>
>> iscsi_get_host_stats was dropping the error code returned
>> by drivers like qla4xxx.
>>
>> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>> ---
>>   drivers/scsi/scsi_transport_iscsi.c |    4 ++++
>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/scsi/scsi_transport_iscsi.c
>> b/drivers/scsi/scsi_transport_iscsi.c
>> index b481e62..14bfa53 100644
>> --- a/drivers/scsi/scsi_transport_iscsi.c
>> +++ b/drivers/scsi/scsi_transport_iscsi.c
>> @@ -3467,6 +3467,10 @@ iscsi_get_host_stats(struct iscsi_transport
>> *transport, struct nlmsghdr *nlh)
>>           memset(buf, 0, host_stats_size);
>>
>>           err = transport->get_host_stats(shost, buf, host_stats_size);
>> +        if (err) {
>> +            kfree(skbhost_stats);
>> +            goto exit_host_stats;
>> +        }
>>
>>           actual_size = nlmsg_total_size(sizeof(*ev) + host_stats_size);
>>           skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size));
>>
> What happens with the skbhost_stats allocated earlier? Shouldn't it be
> freed here, too?
> 

You mean for this success path right. It is not freed here by the iscsi
code on purpose. For the code path here where we have successfully
called into the driver then a couple lines below we will do

iscsi_multicast_skb() -> nlmsg_multicast()

which will pass the skbhost_stats skb to the netlink layer. The
netlink/socket/skb code then frees it when it is done with it.


  reply	other threads:[~2014-07-31 22:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-12 20:51 [PATCH 0/4] iscsi: iscsi changes for 3.17 michaelc
2014-07-12 20:51 ` [PATCH 1/4] iscsi class: fix get_host_stats error handling michaelc
2014-07-30 12:50   ` Hannes Reinecke
2014-07-31 22:32     ` Mike Christie [this message]
2014-08-01 13:31       ` Hannes Reinecke
2014-08-01 16:10         ` Mike Christie
2014-07-12 20:51 ` [PATCH 2/4] qla4xxx: fix get_host_stats error propagation michaelc
2014-07-30 12:51   ` Hannes Reinecke
2014-07-12 20:51 ` [PATCH 3/4] iscsi class: fix get_host_stats return code when not supported michaelc
2014-07-30 12:52   ` Hannes Reinecke
2014-07-12 20:51 ` [PATCH 4/4] libiscsi: return new error code when nop times out michaelc
2014-07-30 12:52   ` Hannes Reinecke
2014-07-13  9:50 ` [PATCH 0/4] iscsi: iscsi changes for 3.17 Christoph Hellwig
2014-07-30 12:51   ` Vikas Chaudhary
2014-07-30 11:43 ` Christoph Hellwig

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=53DAC3F5.5070108@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=hare@suse.de \
    --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.