SPI bus number must be assigned dynamically for each device, otherwise it
will crash when multiple devices are plugged to system.

Cc: sta...@vger.kernel.org
Reported-and-tested-by: syzbot+c60ddb60b685777d9...@syzkaller.appspotmail.com
Signed-off-by: Antti Palosaari <cr...@iki.fi>
---
 drivers/media/usb/msi2500/msi2500.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/msi2500/msi2500.c 
b/drivers/media/usb/msi2500/msi2500.c
index 65be6f140fe8..1c60dfb647e5 100644
--- a/drivers/media/usb/msi2500/msi2500.c
+++ b/drivers/media/usb/msi2500/msi2500.c
@@ -1230,7 +1230,7 @@ static int msi2500_probe(struct usb_interface *intf,
        }
 
        dev->master = master;
-       master->bus_num = 0;
+       master->bus_num = -1;
        master->num_chipselect = 1;
        master->transfer_one_message = msi2500_transfer_one_message;
        spi_master_set_devdata(master, dev);
-- 
2.21.0

Reply via email to