• Mauro Carvalho Chehab's avatar
    media: dvb-ttusb-budget: don't use stack for USB transfers · 36e3cf0c
    Mauro Carvalho Chehab authored
    As reported by smatch:
    
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:311 ttusb_boot_dsp() error: doing dma on the stack (b)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:321 ttusb_boot_dsp() error: doing dma on the stack (b)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:330 ttusb_boot_dsp() error: doing dma on the stack (b)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:351 ttusb_set_channel() error: doing dma on the stack (b)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:361 ttusb_del_channel() error: doing dma on the stack (b)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:412 ttusb_init_controller() error: doing dma on the stack (b0)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:416 ttusb_init_controller() error: doing dma on the stack (b1)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:422 ttusb_init_controller() error: doing dma on the stack (b2)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:425 ttusb_init_controller() error: doing dma on the stack (b3)
        drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c:430 ttusb_init_controller() error: doing dma on the stack (get_version)
    
    This driver still uses the USB stack for DMA transfers,
    which is broken for a long time. I almost dropped this driver,
    as there's a high chance that nobody is using it with upstream
    Kernels, as we didn't receive any bug reports.
    
    As fixing this won't be hard, I ended opting to fix.
    
    While here, I dropped an ugly hack that implemented read via
    a separate function that was just doing a memcpy().
    
    It should be noticed that, during the init phase, there's
    a "b4" register that were never initialized, as its buffer
    were used just to store the results of "b3" initialization.
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    36e3cf0c
dvb-ttusb-budget.c 41.8 KB