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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6B49C35249 for ; Sun, 2 Feb 2020 16:25:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BA4E2067C for ; Sun, 2 Feb 2020 16:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580660709; bh=4fpAHuM+ORaLHkMigKzwC+4vFfeAAgSFS4zhLjmWCy4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=oGzXSDr1emjlAQzASFEV284gMjlnJTSCuVaJE8yM1S0MRcy6mccOaOA1DgZ0XNv9L wSiQ5wBdwd5LjBwDtKeBR1kcFFcSf9KjKVWRjs5RKASE8si5LCEMMRrh5S/P0xHjdP f3BUIrEV3fot7xte5UISoK9FH8AFQXUsWdQ3fiaU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbgBBQZI (ORCPT ); Sun, 2 Feb 2020 11:25:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:38426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgBBQZI (ORCPT ); Sun, 2 Feb 2020 11:25:08 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00BA320679; Sun, 2 Feb 2020 16:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580660707; bh=4fpAHuM+ORaLHkMigKzwC+4vFfeAAgSFS4zhLjmWCy4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hRfKgmOYa0/m0I5C83M3OC2SNaJSoXCNK/7kjaOfDR2PaOeWQenvCYxTeXj96kpiQ Wz1sA9La22Gsh6eZB2f89Rd8O8/uLSTwuz3YtuJ/m8sI/daFrT2h3YCgnUY7zKJHKR DOaiYZFPUpk7pH8D1H2jfNOdtSC7UX266wiaIYfc= Date: Sun, 2 Feb 2020 16:25:02 +0000 From: Jonathan Cameron To: Linus Walleij Cc: Colin King , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio , kernel-janitors@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [PATCH][next] iio: st_sensors: handle memory allocation failure to fix null pointer dereference Message-ID: <20200202162502.0ab50117@archlinux> In-Reply-To: References: <20200121161757.1498082-1-colin.king@canonical.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Jan 2020 16:28:28 +0100 Linus Walleij wrote: > On Tue, Jan 21, 2020 at 5:18 PM Colin King wrote: > > > From: Colin Ian King > > > > A null pointer deference on pdata can occur if the allocation of > > pdata fails. Fix this by adding a null pointer check and handle > > the -ENOMEM failure in the caller. > > > > Addresses-Coverity: ("Dereference null return value") > > That's a weirdo tag, but I suppose you have aligned with the maintainers > about this. > > > Fixes: 3ce85cc4fbb7 ("iio: st_sensors: get platform data from device tree") > > Signed-off-by: Colin Ian King > > Reviewed-by: Linus Walleij Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > > Yours, > Linus Walleij