Messages in this thread Patch in this message | | | From | Robert Baldyga <> | Subject | [PATCH v2 13/13] extcon: extcon-max77693: check if pdata exists | Date | Mon, 14 Apr 2014 13:46:24 +0200 |
| |
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@samsung.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
| |