From: Emil Goode <emilgoode@gmail.com>
To: omar.ramirez@copitl.com, gregkh@linuxfoundation.org,
justinmattock@gmail.com, andriy.shevchenko@linux.intel.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org, Emil Goode <emilgoode@gmail.com>
Subject: [PATCH] staging: tidspbridge: Fix potential NULL pointer dereference
Date: Wed, 12 Jun 2013 16:33:15 +0200 [thread overview]
Message-ID: <1371047595-11702-1-git-send-email-emilgoode@gmail.com> (raw)
We free dcd_key on line 897 and then dereference it a few lines below.
This patch adds a NULL check to make sure we can use dcd_key.
Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
drivers/staging/tidspbridge/rmgr/dbdcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c
index 3d2a26f..21ce3b7 100644
--- a/drivers/staging/tidspbridge/rmgr/dbdcd.c
+++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c
@@ -899,7 +899,7 @@ int dcd_register_object(struct dsp_uuid *uuid_obj,
}
}
spin_unlock(&dbdcd_lock);
- if (&dcd_key->link == ®_key_list)
+ if (dcd_key && (&dcd_key->link == ®_key_list))
status = -EPERM;
}
--
1.7.10.4
next reply other threads:[~2013-06-12 14:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 14:33 Emil Goode [this message]
2013-06-12 15:08 ` [PATCH] staging: tidspbridge: Fix potential NULL pointer dereference Dan Carpenter
2013-06-12 15:33 ` Emil Goode
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=1371047595-11702-1-git-send-email-emilgoode@gmail.com \
--to=emilgoode@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=justinmattock@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=omar.ramirez@copitl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox