diff options
author | Adheer Chandravanshi <adheer.chandravanshi@qlogic.com> | 2014-04-09 21:12:27 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-05-19 13:12:20 -0400 |
commit | 73597bdd8326b2c8a68cd046fd2ac338982cebf1 (patch) | |
tree | 8a7b3abe8fd9a4b00787ff17839386c665a6560e /drivers/scsi/qla4xxx | |
parent | f65241e7294e344f4641131000ea88e3d70fa550 (diff) |
qla4xxx: Fix smatch warning in func qla4xxx_get_ep_param
Fix following smatch warning:-
drivers/scsi/qla4xxx/ql4_os.c:1752 qla4xxx_get_ep_param() warn: variable dereferenced before check 'qla_ep' (see line 1745)
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 9be829bb90db..592f29375a89 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -1742,6 +1742,9 @@ static int qla4xxx_get_ep_param(struct iscsi_endpoint *ep, | |||
1742 | struct sockaddr *dst_addr; | 1742 | struct sockaddr *dst_addr; |
1743 | struct scsi_qla_host *ha; | 1743 | struct scsi_qla_host *ha; |
1744 | 1744 | ||
1745 | if (!qla_ep) | ||
1746 | return -ENOTCONN; | ||
1747 | |||
1745 | ha = to_qla_host(qla_ep->host); | 1748 | ha = to_qla_host(qla_ep->host); |
1746 | DEBUG2(ql4_printk(KERN_INFO, ha, "%s: host: %ld\n", __func__, | 1749 | DEBUG2(ql4_printk(KERN_INFO, ha, "%s: host: %ld\n", __func__, |
1747 | ha->host_no)); | 1750 | ha->host_no)); |
@@ -1749,9 +1752,6 @@ static int qla4xxx_get_ep_param(struct iscsi_endpoint *ep, | |||
1749 | switch (param) { | 1752 | switch (param) { |
1750 | case ISCSI_PARAM_CONN_PORT: | 1753 | case ISCSI_PARAM_CONN_PORT: |
1751 | case ISCSI_PARAM_CONN_ADDRESS: | 1754 | case ISCSI_PARAM_CONN_ADDRESS: |
1752 | if (!qla_ep) | ||
1753 | return -ENOTCONN; | ||
1754 | |||
1755 | dst_addr = (struct sockaddr *)&qla_ep->dst_addr; | 1755 | dst_addr = (struct sockaddr *)&qla_ep->dst_addr; |
1756 | if (!dst_addr) | 1756 | if (!dst_addr) |
1757 | return -ENOTCONN; | 1757 | return -ENOTCONN; |