iscsi class: fix get_host_stats error handling
authorMike Christie <michaelc@cs.wisc.edu>
Sat, 12 Jul 2014 20:51:48 +0000 (15:51 -0500)
committerChristoph Hellwig <hch@lst.de>
Fri, 1 Aug 2014 12:16:39 +0000 (08:16 -0400)
iscsi_get_host_stats was dropping the error code returned
by drivers like qla4xxx.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/scsi_transport_iscsi.c

index b481e62..14bfa53 100644 (file)
@@ -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));