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 5EE76C4332F for ; Wed, 14 Dec 2022 08:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237716AbiLNI0I (ORCPT ); Wed, 14 Dec 2022 03:26:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237671AbiLNIZ4 (ORCPT ); Wed, 14 Dec 2022 03:25:56 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7BD91EEE2; Wed, 14 Dec 2022 00:25:55 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 31A6761844; Wed, 14 Dec 2022 08:25:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 141E2C433AC; Wed, 14 Dec 2022 08:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1671006354; bh=nUhA1KN+yRl+UoxzA4ZvEUH9cmzVGlUJ/vaEO+7pygI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LsbQHL2YXxb5IMvaSJ7+YYdciPjG0QapQJSC0aODWhZWLAA24qZQ+IUljHoQzZVaf Kvgosw3knqxIc+u2CVFEGazvDlgaCKNs+RLLY5wol3TftjXDY3VXc55krmFoHhowjo 0y4RU41w/u/7hgXMVyvBASAKpWQ/uyge07tHMDbw= Date: Wed, 14 Dec 2022 09:25:51 +0100 From: Greg KH To: Jiasheng Jiang Cc: neal_liu@aspeedtech.com, joel@jms.id.au, andrew@aj.id.au, sumit.semwal@linaro.org, christian.koenig@amd.com, linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v2] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent Message-ID: References: <20221214025414.44866-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221214025414.44866-1-jiasheng@iscas.ac.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 14, 2022 at 10:54:14AM +0800, Jiasheng Jiang wrote: > Add the check for the return value of dma_alloc_coherent in order to > avoid NULL pointer dereference. > > This flaw was found using an experimental static analysis tool we are > developing, APP-Miner, which has not been disclosed. > > The allyesconfig build using GCC 9.3.0 shows no new warning. As we > don't have a UDC device to test with, no runtime testing was able to > be performed. > > Signed-off-by: Jiasheng Jiang > --- > Changelog: > > v1 -> v2: > > 1. Add "goto err;" when allocation fails. You already sent a previous v2 that differs from this one, this should be v3, right?