From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0E967C for ; Mon, 24 Apr 2023 13:24:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78DF2C433D2; Mon, 24 Apr 2023 13:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1682342650; bh=L2mgMJpo5Zd2k4BM1LcSfgpYKrfcpomgIOIz9dDA9xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AhDWIqOgHmhGn7mcqGbL9M5C8Hb+THRljyT4EmmuXkCLtxqJ/6627f/5fJXG12H2f Aq46IiWD7Fv20ZN3ul95CRfkBz8HKAuNeFZ/yo3JcGEdAoHVfaCpoKwMl51tGBeNRm RXJtQUbJpUQk9K9sAyQm0t56L23Laii1d4gwyg7o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Jonathan Cameron Subject: [PATCH 5.4 38/39] iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_trigger() Date: Mon, 24 Apr 2023 15:17:41 +0200 Message-Id: <20230424131124.482368982@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230424131123.040556994@linuxfoundation.org> References: <20230424131123.040556994@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Dan Carpenter commit 73a428b37b9b538f8f8fe61caa45e7f243bab87c upstream. The at91_adc_allocate_trigger() function is supposed to return error pointers. Returning a NULL will cause an Oops. Fixes: 5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/5d728f9d-31d1-410d-a0b3-df6a63a2c8ba@kili.mountain Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/at91-sama5d2_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -983,7 +983,7 @@ static struct iio_trigger *at91_adc_allo trig = devm_iio_trigger_alloc(&indio->dev, "%s-dev%d-%s", indio->name, indio->id, trigger_name); if (!trig) - return NULL; + return ERR_PTR(-ENOMEM); trig->dev.parent = indio->dev.parent; iio_trigger_set_drvdata(trig, indio);