From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com ([209.85.220.46]:35669 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934899AbbIVV7A (ORCPT ); Tue, 22 Sep 2015 17:59:00 -0400 Received: by pacfv12 with SMTP id fv12so20811963pac.2 for ; Tue, 22 Sep 2015 14:58:59 -0700 (PDT) Date: Tue, 22 Sep 2015 22:58:53 +0100 From: Lee Jones To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , stable@vger.kernel.org, Samuel Ortiz Subject: Re: [RESEND PATCH] mfd: max77843: Fix max77843_chg_init() return on error Message-ID: <20150922215853.GE3442@x1> References: <1442838414-3807-1-git-send-email-javier@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1442838414-3807-1-git-send-email-javier@osg.samsung.com> Sender: stable-owner@vger.kernel.org List-ID: On Mon, 21 Sep 2015, Javier Martinez Canillas wrote: > 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 > Reviewed-by: Krzysztof Kozlowski > > --- > 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(-) Applied, thanks. > 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); > -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog