All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: most: hdm-dim2: Remove possible dereference error
@ 2016-03-18 13:02 Amitoj Kaur Chawla
       [not found] ` <20160318141409.GA2555@arch.fritz.box>
  0 siblings, 1 reply; 2+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-18 13:02 UTC (permalink / raw)
  To: outreachy-kernel, dan.carpenter; +Cc: devel

Commit 3eced21a5afb ("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 warning by returning PTR_ERR immediately rather than 
storing in a variable and returning at the end of the function
since we do not need to free anything.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/staging/most/hdm-dim2/dim2_hdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c b/drivers/staging/most/hdm-dim2/dim2_hdm.c
index 0dc86ad..a364495 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hdm.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c
@@ -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;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: most: hdm-dim2: Remove possible dereference error
       [not found] ` <20160318141409.GA2555@arch.fritz.box>
@ 2016-03-18 17:12   ` Amitoj Kaur Chawla
  0 siblings, 0 replies; 2+ messages in thread
From: Amitoj Kaur Chawla @ 2016-03-18 17:12 UTC (permalink / raw)
  To: Andrey Shvetsov; +Cc: outreachy-kernel, Dan Carpenter, devel

On Fri, Mar 18, 2016 at 7:44 PM, Andrey Shvetsov
<andrey.shvetsov.ml@gmail.com> wrote:
> On Fri, Mar 18, 2016 at 06:32:15PM +0530, Amitoj Kaur Chawla wrote:
>> Commit 3eced21a5afb ("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 warning by returning PTR_ERR immediately rather than
>> storing in a variable and returning at the end of the function
>> since we do not need to free anything.
> This patch is not about a warning.
>
> This patch fixes the bug introduced in the previous patch that has
> changed the control flow so that the error code returned by the
> kthread_run was overwritten by the "ret = dim2_sysfs_probe" below.
>
> regards
> andy

I'll revise the commit message and resend.

Thanks,
Amitoj


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-18 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-18 13:02 [PATCH] staging: most: hdm-dim2: Remove possible dereference error Amitoj Kaur Chawla
     [not found] ` <20160318141409.GA2555@arch.fritz.box>
2016-03-18 17:12   ` Amitoj Kaur Chawla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.