All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amitoj Kaur Chawla <amitoj1606@gmail.com>
To: outreachy-kernel@googlegroups.com, dan.carpenter@oracle.com
Cc: devel@driverdev.osuosl.org
Subject: [PATCH] staging: most: hdm-dim2: Remove possible dereference error
Date: Fri, 18 Mar 2016 18:32:15 +0530	[thread overview]
Message-ID: <20160318130215.GA24475@amitoj-Inspiron-3542> (raw)

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



             reply	other threads:[~2016-03-18 13:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 13:02 Amitoj Kaur Chawla [this message]
     [not found] ` <20160318141409.GA2555@arch.fritz.box>
2016-03-18 17:12   ` [PATCH] staging: most: hdm-dim2: Remove possible dereference error Amitoj Kaur Chawla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160318130215.GA24475@amitoj-Inspiron-3542 \
    --to=amitoj1606@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.