Linux wireless drivers development
 help / color / mirror / Atom feed
From: Carlo Caione <carlo@caione.org>
To: johannes@sipsolutions.net, linux-wireless@vger.kernel.org,
	frederic.danis.oss@gmail.com, sebastian.reichel@collabora.co.uk,
	rafael.j.wysocki@intel.com, hdegoede@redhat.com,
	linux@endlessm.com
Cc: Carlo Caione <carlo@endlessm.com>
Subject: [RFC PATCH 1/2] net: rfkill: gpio: Fix NULL pointer deference
Date: Tue, 20 Feb 2018 13:46:17 +0000	[thread overview]
Message-ID: <20180220134618.12972-2-carlo@caione.org> (raw)
In-Reply-To: <20180220134618.12972-1-carlo@caione.org>

From: Carlo Caione <carlo@endlessm.com>

In the rfkill_gpio code the variable type_name is not initialized and it
can point to a spurious memory location. When
device_property_read_string is not able to locate the string we are
passing to rfkill_find_type this random pointer, causing a NULL pointer
dereference when using strcmp.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
---
 net/rfkill/rfkill-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 41bd496531d4..659d2edae972 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -88,7 +88,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
 {
 	struct rfkill_gpio_data *rfkill;
 	struct gpio_desc *gpio;
-	const char *type_name;
+	const char *type_name = NULL;
 	int ret;
 
 	rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL);
-- 
2.14.1

  reply	other threads:[~2018-02-20 13:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 13:46 [RFC PATCH 0/2] net: rfkill: gpio: Fix and support SerDev Carlo Caione
2018-02-20 13:46 ` Carlo Caione [this message]
2018-02-20 13:46 ` [RFC PATCH 2/2] net: rfkill: gpio: Convert driver to SerDev Carlo Caione
2018-02-20 14:04   ` Marcel Holtmann
2018-02-20 14:40     ` Carlo Caione
2018-02-20 14:01 ` [RFC PATCH 0/2] net: rfkill: gpio: Fix and support SerDev Hans de Goede
2018-02-20 14:10   ` Marcel Holtmann
2018-02-20 14:36   ` Carlo Caione
2018-02-20 15:55     ` Marcel Holtmann
2018-02-20 16:15     ` Hans de Goede
2018-02-20 20:26       ` Martin Blumenstingl
2018-02-20 21:18         ` Jeremy Cline
2018-02-20 21:34           ` Carlo Caione
2018-02-21  8:27             ` Marcel Holtmann
2018-02-21 15:35             ` Jeremy Cline
2018-02-21  8:26         ` Marcel Holtmann

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=20180220134618.12972-2-carlo@caione.org \
    --to=carlo@caione.org \
    --cc=carlo@endlessm.com \
    --cc=frederic.danis.oss@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sebastian.reichel@collabora.co.uk \
    /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