]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
tcm_usb_gadget: Don't strip off nexus WWPN prefix
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 11 Dec 2015 15:06:13 +0000 (16:06 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 21 Dec 2015 03:40:05 +0000 (19:40 -0800)
Avoid stripping off the 'naa.' I_T nexus prefix from configfs
attribute store input, so that user-space will get back what
it originaly wrote into ../usb_gadget/$WWPN/$TPGT/nexus.

Note the SCSI initiator WWPN is purely symbolic for UAS + BOT,
so it will not effect host side code.

Reported-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/usb/gadget/legacy/tcm_usb_gadget.c

index 22e56158d5850236242375d036f70250b676dac7..edc74d347d9876e212e1cba13c8730549a3d225e 100644 (file)
@@ -1657,7 +1657,7 @@ static ssize_t tcm_usbg_tpg_nexus_store(struct config_item *item,
        if (i_port[strlen(i_port) - 1] == '\n')
                i_port[strlen(i_port) - 1] = '\0';
 
-       ret = tcm_usbg_make_nexus(tpg, &i_port[4]);
+       ret = tcm_usbg_make_nexus(tpg, &i_port[0]);
        if (ret < 0)
                return ret;
        return count;