Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp362865rdb; Sat, 17 Feb 2024 11:45:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWqrUIBnBxCNfNvGXbVMQ1NV273+phRv+1k23TO4K0Nl6McbZc6vO+jrZzjzW+IsAuJlGrGYq90VM9QEXRkOX+Rf1HIhczpgi+v2i/Uog== X-Google-Smtp-Source: AGHT+IFyhEYl9CCNfvpTMrdWrFRyiXZiCNyuPaOqcDQ/BKY40EswYnF6Gn14NJpV8En0eN4tVyvn X-Received: by 2002:a05:6358:27a9:b0:178:f482:6e50 with SMTP id l41-20020a05635827a900b00178f4826e50mr9914751rwb.11.1708199111719; Sat, 17 Feb 2024 11:45:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708199111; cv=pass; d=google.com; s=arc-20160816; b=wnl4pe8q/KF6dBnG+jmyHNu//orLiIkuUSkcL3SHDHHJN8/HC99hrm9IasHP1IVVfr +kwd7NAHqcfg3FOtdb2kLrY3Pc2G5NIu1jsScMCdklDvn77WTJm8BbZBhxZg+Dddw8bc 4GyfwYptNmAoa9S3d/QjP2zgCptH05WUAyDhLEwqYEuhlOopIa0Jnu94jXqCHniAA1hq LfIaRuXa57akwLOVke0wS5KMDazs9at6d1VSJ8OX4TfC6miXW4fE/7m/v9Ug4wK6z5eY vb2NXXxAzNwIQwiLBut2z1tBZlxEQkmBKAkndnTFysLeIBkMy9a6Tst0xj/odG+hFpz7 4bpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:date:cc:to:from:subject :message-id; bh=Y2RZ23m9enNKotmbzmfdjyTwnNwA6e7DAWHJvHIfF94=; fh=Ze92c/HYyJIJFv0g9wvhSjW0W2oOc3HrJNUFJ4b2Vh4=; b=bv/6rzTWDVqvZvN6bpPghowTxWpCVAQYwsTqHlYtG+V/eKP8Nfp3xl+WSBq6EwGmho 6a1gJVluMwNa3YJl/ljmSnBarvnpJtBnk19P579q2WFh0/ey2Bw8foAzEol/HmltimRF Qz47aJU3OemjeBlBXj89I4mY5DaL6O++lHzfIefutY8SoJB7aTMAUFEbvQ+6fsnUGNvk gYtUBJHRYoN/T3wyD8ugIIFIEotfnSdxmrQaL9pH1GIVH8LwW6M1NJlSKsf06U4BB/lw +w0SSCvFKIHLbSh6i2WoJpq8PQg8JnG+IYCa3J8aEKo3GhFtPXm3bw64wCA7lNem9Vrg iQkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-70040-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70040-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id il17-20020a17090b165100b00298ff25a532si2009782pjb.63.2024.02.17.11.45.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 11:45:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70040-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-70040-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70040-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 65F5E2833AF for ; Sat, 17 Feb 2024 19:45:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE31D7E58C; Sat, 17 Feb 2024 19:45:03 +0000 (UTC) Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) (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 B9B4B7CF2C; Sat, 17 Feb 2024 19:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708199103; cv=none; b=CsEqrxcKthYz8q1IF+3uV9id8f9g+4hhrj658x9FsF86PSSYxjYmlMDcHgqGqYJNkerabgFiuYmWaN0JPM7iMb71M0SX5J0mih0h7vNeSZiRdHg7Mn4qXS3hW4t/kiTQJJzI3tw8vfq8jIJweSJN1LQgar6/WJWJ9w6CLn9YWes= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708199103; c=relaxed/simple; bh=/ClP/g3jt0iF43oyMub7Rq699tZLH1yRu5G6Rpzq7Ks=; h=Message-ID:Subject:From:To:Cc:Date:Content-Type:MIME-Version; b=Gd2UvcgVTUpU1oILqZA1FuH6oh6u13jSMrHP9HLLDVlPv/h16U5qNzFHhKdBKCT38BJEDk6gfsyTaaBIcIwV08Uv++3HRVehBmcE+aox7yaToBGZ5pwTgKUJOxwZo363fe+Ssrh19g7UFTsMnUvDg24SWFIxTSM8Nx/gE+yEU6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com; spf=pass smtp.mailfrom=perches.com; arc=none smtp.client-ip=216.40.44.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C5D281C0269; Sat, 17 Feb 2024 19:44:59 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA id 0EEA320025; Sat, 17 Feb 2024 19:44:56 +0000 (UTC) Message-ID: <102e5c65e07ebdade5400ca711fba131a37027a8.camel@perches.com> Subject: mediatek: media: Missing alloc null test From: Joe Perches To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong Cc: Mauro Carvalho Chehab , Matthias Brugger , AngeloGioacchino Del Regno , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek Date: Sat, 17 Feb 2024 11:44:56 -0800 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 0EEA320025 X-Rspamd-Server: rspamout08 X-Stat-Signature: jtj5gxkjrn6psxqbp7ktoek7c5w55gzq X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/mi3Mj5scL1ByOsIwBfWZOxpOvRRYeA7Y= X-HE-Tag: 1708199096-891621 X-HE-Meta: U2FsdGVkX193Saf57q9yIF6MDuyE5/FDuYOW0Jg6+JkwL2LwrgbYynYObJBWcqCClxlv4MeR25Rb48n5OI1kDPWQaZCTPjJiFzlCnThe+luGs/P1grkpEswA4zNaoAOWJxt6LVHEq7FF5DaqtJLR0sBuNMMuwYV8MGShqen58zm0lAaMXpzxFzD6FKbX3KYS+ux3tYQQhalVyv3kB3KbJ8nJknEFY08TAGSN/kxcfcmejaBHtHI5ngt+k8fiLwu8iRg67fftVlJHRv53JNdp9oAWcLtn5U/CnNtuWtijsWOJPl/z7AUNDgM4zaNPSQQ+ There's a missing NULL alloc test here: It doesn't appear obvious what a proper fix is. diff -u -p ./drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_sc= p.c /tmp/nothing/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_f= w_scp.c --- ./drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c +++ /tmp/nothing/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_f= w_scp.c @@ -79,7 +79,6 @@ struct mtk_vcodec_fw *mtk_vcodec_fw_scp_ } =20 fw =3D devm_kzalloc(&plat_dev->dev, sizeof(*fw), GFP_KERNEL); - fw->type =3D SCP; fw->ops =3D &mtk_vcodec_rproc_msg; fw->scp =3D scp;