public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] mfd: max77843: Fix max77843_chg_init() return on error
@ 2015-09-21 12:26 Javier Martinez Canillas
  2015-09-22 21:58 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Javier Martinez Canillas @ 2015-09-21 12:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Krzysztof Kozlowski, stable, Javier Martinez Canillas, Lee Jones,
	Samuel Ortiz

If i2c_new_dummy() fails in max77843_chg_init(), an PTR_ERR(NULL) is
returned which is 0. So the function was wrongly returning a success
value instead of an error code.

Cc: stable@vger.kernel.org # 4.1
Fixes: c7f585fe46d8 ("mfd: max77843: Add max77843 MFD driver core driver")
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

---
Changes in the RESEND:
- Added Krzysztof's Reviewed-by tag.
- Added a tag for stable.

 drivers/mfd/max77843.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/max77843.c b/drivers/mfd/max77843.c
index c52162ea3d0a..586098f1b233 100644
--- a/drivers/mfd/max77843.c
+++ b/drivers/mfd/max77843.c
@@ -80,7 +80,7 @@ static int max77843_chg_init(struct max77693_dev *max77843)
 	if (!max77843->i2c_chg) {
 		dev_err(&max77843->i2c->dev,
 				"Cannot allocate I2C device for Charger\n");
-		return PTR_ERR(max77843->i2c_chg);
+		return -ENODEV;
 	}
 	i2c_set_clientdata(max77843->i2c_chg, max77843);
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-22 21:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 12:26 [RESEND PATCH] mfd: max77843: Fix max77843_chg_init() return on error Javier Martinez Canillas
2015-09-22 21:58 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox