staging: most: hdm-dim2: Remove possible dereference error

Commit 3eced21a5a ("staging: most: hdm-dim2: Replace request_irq
with devm_request_irq") introduced the following static checker
warning:

drivers/staging/most/hdm-dim2/dim2_hdm.c:841 dim2_probe() error: 'dev->netinfo_task' dereferencing possible ERR_PTR()

Remove the bug introduced by the commit due to change in control flow
by returning PTR_ERR immediately rather than returning at the end of
the function since we do not need to free anything.

Fixes: 3eced21a5a
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Amitoj Kaur Chawla 2016-03-19 00:47:41 +05:30 committed by Greg Kroah-Hartman
parent 3092c34a4a
commit 982177677a

View File

@ -771,7 +771,7 @@ static int dim2_probe(struct platform_device *pdev)
dev->netinfo_task = kthread_run(&deliver_netinfo_thread, (void *)dev,
"dim2_netinfo");
if (IS_ERR(dev->netinfo_task))
ret = PTR_ERR(dev->netinfo_task);
return PTR_ERR(dev->netinfo_task);
for (i = 0; i < DMA_CHANNELS; i++) {
struct most_channel_capability *cap = dev->capabilities + i;