Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3075521rwb; Fri, 16 Dec 2022 09:44:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf7lSS6C1cnjKfYUAXqEziqoMmn1WvfpNkUCrSOoTPFiBhDeDlKB68aiC1kNCgzveFvllW8E X-Received: by 2002:a17:90a:d317:b0:219:f385:33a9 with SMTP id p23-20020a17090ad31700b00219f38533a9mr34829567pju.27.1671212694082; Fri, 16 Dec 2022 09:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671212694; cv=none; d=google.com; s=arc-20160816; b=zF2KUJDWyTUdoJxgZ+z62COrDAlQZvqfBo9zgFsytzHQua/BdYJ8jCRztzIHdMwa87 ayGCNZDxZF/BAljOUB6wahdmQCkeFVZtT+OAt7bHov13jbFozUmtbEMvtdBn1sbnj6qC XDbg4jq8EGcpY6WSb6/spqPEaGWbfkT8aZBsfVEw6CQCb/FneEdawND531LhPKA4qeVM tyenc+mjxHzSMucuoMy0qqUmF79ntGl64gwcxbUTx7fUnxXoWD5x8ytEfpak+SJv6cUh IUJun/EtkhV5t34W8c9dD7jXRgTtlB7whzBYFL9ZAEcuvgP1Qc9UdbK8DfbnK60zhw3k oMMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=SagNf3EEhfF8k5hEcvjZIQ/CAm15xswuroxwqiPStKM=; b=dZ5zmQ7Paf/kXPrrIbbgztEeMegpL43Uk5szlnFWi+I1feWdNLcYCFXZvOj/uwlW3/ qlmxR3Lz/cM1artCw+EQE/JbWHUVUZWgugX4SgxEXri5MktLHlt82Bwfa3KeovFkDjRq 4QE54N/fGS6uzwyHhwlPoU1TRWRkYEEICGqoifCd2Pq1lQYBeAFtYvqpgUBAoSp8g+5T rD/xfpe87LfAxbXFINeEJHYZDmui3V09UMpZjAohbu7SHc4WswyxZKTGwFvIJxiB3t9D /n1V4xznLW+3BY53xcSfSaXr1KxiC8Uik4YnCuYNj0ASZmcmTfMFNN2XiJ/nOVvbQ1N5 cTvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pt15-20020a17090b3d0f00b00219a48a3bf9si2885850pjb.93.2022.12.16.09.44.45; Fri, 16 Dec 2022 09:44:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231829AbiLPReB convert rfc822-to-8bit (ORCPT + 68 others); Fri, 16 Dec 2022 12:34:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231817AbiLPRd6 (ORCPT ); Fri, 16 Dec 2022 12:33:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E36619C3F for ; Fri, 16 Dec 2022 09:33:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6Eal-0001SO-Em; Fri, 16 Dec 2022 18:33:51 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1p6Eak-004yJv-24; Fri, 16 Dec 2022 18:33:50 +0100 Received: from pza by lupine with local (Exim 4.94.2) (envelope-from ) id 1p6Eak-000CcO-5F; Fri, 16 Dec 2022 18:33:50 +0100 Message-ID: Subject: Re: [PATCH] media: coda: Add check for kmalloc From: Philipp Zabel To: Jiasheng Jiang , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 16 Dec 2022 18:33:49 +0100 In-Reply-To: <20221117070236.44632-1-jiasheng@iscas.ac.cn> References: <20221117070236.44632-1-jiasheng@iscas.ac.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Do, 2022-11-17 at 15:02 +0800, Jiasheng Jiang wrote: > As the kmalloc may return NULL pointer, > it should be better to check the return value > in order to avoid NULL poineter dereference, > same as the others. > > Fixes: cb1d3a336371 ("[media] coda: add CODA7541 JPEG support") > Signed-off-by: Jiasheng Jiang Reviewed-by: Philipp Zabel regards Philipp