staging: kpc2000: kpc_dma: set error code in probe
If device_create() fails during probing the device, kpc_dma_probe() does not set the error code and returns 0. This can result in various bad issues later. The patch sets the error code on the corresponding error handling path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov <novikov@ispras.ru> Link: https://lore.kernel.org/r/20200623082959.14951-1-novikov@ispras.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c8a00029dc
commit
8ce8668bfb
|
@ -140,6 +140,7 @@ int kpc_dma_probe(struct platform_device *pldev)
|
|||
dev = MKDEV(assigned_major_num, pldev->id);
|
||||
ldev->kpc_dma_dev = device_create(kpc_dma_class, &pldev->dev, dev, ldev, "kpc_dma%d", pldev->id);
|
||||
if (IS_ERR(ldev->kpc_dma_dev)) {
|
||||
rv = PTR_ERR(ldev->kpc_dma_dev);
|
||||
dev_err(&ldev->pldev->dev, "%s: device_create failed: %d\n", __func__, rv);
|
||||
goto err_kfree;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue