[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1397135811-12866-14-git-send-email-r.baldyga@samsung.com>
Date: Thu, 10 Apr 2014 15:16:51 +0200
From: Robert Baldyga <r.baldyga@...sung.com>
To: unlisted-recipients:; (no To-header on input)
Cc: robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
rob@...dley.net, myungjoo.ham@...sung.com, cw00.choi@...sung.com,
dbaryshkov@...il.com, dwmw2@...radead.org, balbi@...com,
gregkh@...uxfoundation.org, grant.likely@...aro.org,
ldewangan@...dia.com, kishon@...com, gg@...mlogic.co.uk,
anton@...msg.org, jonghwa3.lee@...sung.com, rongjun.ying@....com,
linux@...ck-us.net, aaro.koskinen@....fi, tony@...mide.com,
devicetree@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, patches@...nsource.wolfsonmicro.com,
linux-usb@...r.kernel.org, linux-omap@...r.kernel.org,
Robert Baldyga <r.baldyga@...sung.com>
Subject: [PATCH 13/13] extcon: extcon-max77693: check if pdata exists
This patch adds check if pdata is NULL, to avoid NULL pointer dereference
when platform data is not available. After this changes, in described
situation driver will be configured with default values.
Signed-off-by: Robert Baldyga <r.baldyga@...sung.com>
---
drivers/extcon/extcon-max77693.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 2cd8892..fa8534e 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -1210,7 +1210,7 @@ static int max77693_muic_probe(struct platform_device *pdev)
/* Initialize MUIC register by using platform data or default data */
- if (pdata->muic_data) {
+ if (pdata && pdata->muic_data) {
init_data = pdata->muic_data->init_data;
num_init_data = pdata->muic_data->num_init_data;
} else {
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists