From: Manish Rangankar Date: Mon, 21 Jan 2013 04:51:04 +0000 (-0500) Subject: [SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param. X-Git-Tag: next-20130218~72^2~8 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c7a5e0d0ebb01fa5f266ddbf8d3d95affcd0f336;p=karo-tx-linux.git [SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param. While reading sysfs chap_in_idx and chap_out_idx attribute, if chap authentication is not set we get an error as "Invalid argument". Signed-off-by: Manish Rangankar Signed-off-by: Vikas Chaudhary Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index b8acc40d6f6c..6142729167f4 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -1337,18 +1337,18 @@ static int qla4xxx_session_get_param(struct iscsi_cls_session *cls_sess, sess->password_in, BIDI_CHAP, &idx); if (rval) - return -EINVAL; - - len = sprintf(buf, "%hu\n", idx); + len = sprintf(buf, "\n"); + else + len = sprintf(buf, "%hu\n", idx); break; case ISCSI_PARAM_CHAP_OUT_IDX: rval = qla4xxx_get_chap_index(ha, sess->username, sess->password, LOCAL_CHAP, &idx); if (rval) - return -EINVAL; - - len = sprintf(buf, "%hu\n", idx); + len = sprintf(buf, "\n"); + else + len = sprintf(buf, "%hu\n", idx); break; default: return iscsi_session_get_param(cls_sess, param, buf);