From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B995C433F5 for ; Sun, 2 Oct 2022 12:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbiJBMzD (ORCPT ); Sun, 2 Oct 2022 08:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbiJBMzA (ORCPT ); Sun, 2 Oct 2022 08:55:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F38552655D; Sun, 2 Oct 2022 05:54:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AA7F0B80D33; Sun, 2 Oct 2022 12:54:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86BD7C433C1; Sun, 2 Oct 2022 12:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664715296; bh=mfHKMtXZfHvWDjYAzhBW3GrdyW5sJh9RiHPmj6UhT9k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Cjf9dEWkuu79zI40Yj6RO3hQmyp4SXI/K9R2dEv6z+0T/C/0dFG/22373Dy7DT94q rWb752S6zyySDZDyglRJBc1oegHOtVwL3KfaR6QfpJHOqapYY2QCff6a4kFW9Sk6i6 kvyLu+l/J8qM7LEL25SQPA2CLYJj7Zo+L37Ebfiw9gACJVa1Dc9fn/6mAsW1bjvKZK 34YmkhAbzlUsfD3yN83bL9NYvsww5Pv5o0cfz4jrk2ju+2VHWz/zEA1HUwOiUHXRm+ e8Ttx5MET+PTxyQ80Ikyi91fS+0c7GEPRoYluaYFyBr0MBpXZemyWr0vC+xWiUQIJb rWtBYVPfaN5Ng== Date: Sun, 2 Oct 2022 13:55:12 +0100 From: Jonathan Cameron To: Marcus Folkesson Cc: Kent Gustavsson , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot , Dan Carpenter Subject: Re: [PATCH] iio: adc: mcp3911: return proper error code on failure to allocate trigger Message-ID: <20221002135512.7cf08a9f@jic23-huawei> In-Reply-To: <20220927092537.94663-1-marcus.folkesson@gmail.com> References: <20220927092537.94663-1-marcus.folkesson@gmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Sep 2022 11:25:37 +0200 Marcus Folkesson wrote: > smatch warnings: > drivers/iio/adc/mcp3911.c:441 mcp3911_probe() warn: passing zero to 'PTR_ERR' > > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Signed-off-by: Marcus Folkesson Applied, with addition of fixes tag to the fixes-togreg branch of iio.git. Slightly messy at this point in the cycle, but I can't push this out until Linus takes Greg's char-misc-next pull request as otherwise linux-next will get the content of Greg's tree via mine an potentially make a mess. Should only matter for a few days though then I'll push my fixes-togreg branch out (which I've moved to being based on char-misc-next to allow me to apply a few patches for things only recently introduced). Jonathan > --- > drivers/iio/adc/mcp3911.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c > index 0d768006eabb..e55db02c534f 100644 > --- a/drivers/iio/adc/mcp3911.c > +++ b/drivers/iio/adc/mcp3911.c > @@ -554,7 +554,7 @@ static int mcp3911_probe(struct spi_device *spi) > indio_dev->name, > iio_device_id(indio_dev)); > if (!adc->trig) > - return PTR_ERR(adc->trig); > + return -ENOMEM; > > adc->trig->ops = &mcp3911_trigger_ops; > iio_trigger_set_drvdata(adc->trig, adc);