From 2f7608fc5e6c8a70df3ce31406feee70a42458ba Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Sat, 12 Jul 2014 15:51:48 -0500 Subject: iscsi class: fix get_host_stats error handling iscsi_get_host_stats was dropping the error code returned by drivers like qla4xxx. Signed-off-by: Mike Christie Acked-by: Vikas Chaudhary Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_transport_iscsi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/scsi') diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index b481e62a12cc..14bfa53c6f7d 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)); -- cgit v1.2.3