usb-storage: alauda: fix initFunction error return
Bugzilla: http://bugzilla.redhat.com/2084667 Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=46653455 Tested: HP ZBook 15 G5/80D5 Laptop commit 17b2fb9c231ea418fa6c8643f2c786ec991b56f5 Author: Lin Ma <linma@zju.edu.cn> Date: Thu Apr 7 10:20:58 2022 +0800 usb-storage: alauda: fix initFunction error return The initFunction is called when probing a new device, its call relation is like: USB core: probe() -> usb_stor_probe2() -> usb_stor_acquire_resources() -> init_alauda() That is, the error return of the initFunction should tell USB core what happened instead of using error code like USB_STOR_TRANSPORT_ERROR. Signed-off-by: Lin Ma <linma@zju.edu.cn> Link: https://lore.kernel.org/r/20220407022058.3741-1-linma@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Torez Smith <torez@redhat.com>
This commit is contained in:
parent
b135eee805
commit
a63fb411cd
|
@ -1104,7 +1104,7 @@ static int init_alauda(struct us_data *us)
|
|||
|
||||
us->extra = kzalloc(sizeof(struct alauda_info), GFP_NOIO);
|
||||
if (!us->extra)
|
||||
return USB_STOR_TRANSPORT_ERROR;
|
||||
return -ENOMEM;
|
||||
|
||||
info = (struct alauda_info *) us->extra;
|
||||
us->extra_destructor = alauda_info_destructor;
|
||||
|
@ -1113,7 +1113,7 @@ static int init_alauda(struct us_data *us)
|
|||
altsetting->endpoint[0].desc.bEndpointAddress
|
||||
& USB_ENDPOINT_NUMBER_MASK);
|
||||
|
||||
return USB_STOR_TRANSPORT_GOOD;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int alauda_transport(struct scsi_cmnd *srb, struct us_data *us)
|
||||
|
|
Loading…
Reference in New Issue