linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] mfd: max8997: Return proper error if pdata is NULL
@ 2013-04-13 13:56 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2013-04-13 13:56 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: MyungJoo Ham, linux-kernel

Return proper error instead of 0 if pdata is NULL.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/mfd/max8997.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 1471405..823f34b 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -209,8 +209,10 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
 		}
 	}
 
-	if (!pdata)
+	if (!pdata) {
+		ret = -ENOMEM;
 		goto err;
+	}
 
 	max8997->pdata = pdata;
 	max8997->ono = pdata->ono;
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-13 13:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-13 13:56 [PATCH RESEND] mfd: max8997: Return proper error if pdata is NULL Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).