Message ID | 1397135811-12866-13-git-send-email-r.baldyga@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index c071588..d7d12e9 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -726,7 +726,7 @@ static int max8997_muic_probe(struct platform_device *pdev) goto err_irq; } - if (pdata->muic_pdata) { + if (pdata && pdata->muic_pdata) { struct max8997_muic_platform_data *muic_pdata = pdata->muic_pdata;
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-max8997.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)