scsi_transport_iscsi: return -EOVERFLOW for Too many iscsi targets
authorJaswinder Singh Rajput <jaswinder@kernel.org>
Sat, 20 Jun 2009 07:59:21 +0000 (13:29 +0530)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sun, 21 Jun 2009 16:58:11 +0000 (11:58 -0500)
setting err as -EOVERFLOW for Too many iscsi targets.

Also fixes a spurious compiler warning for gcc 4.3.3 and gcc 4.4 :

  CC      drivers/scsi/scsi_transport_iscsi.o
drivers/scsi/scsi_transport_iscsi.c: In function ‘iscsi_add_session’:
drivers/scsi/scsi_transport_iscsi.c:678: warning: ‘err’ may be used uninitialized in this function

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/scsi_transport_iscsi.c

index f3e664628d7ae273d6e97c2f794d990b7ea9dcfd..783e33c65eb7c354a5e6613f2653c0b95517f51c 100644 (file)
@@ -692,6 +692,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
                                                 "Too many iscsi targets. Max "
                                                 "number of targets is %d.\n",
                                                 ISCSI_MAX_TARGET - 1);
+                       err = -EOVERFLOW;
                        goto release_host;
                }
        }