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 55FAAC32771 for ; Sat, 24 Sep 2022 09:23:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233435AbiIXJXT (ORCPT ); Sat, 24 Sep 2022 05:23:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiIXJXS (ORCPT ); Sat, 24 Sep 2022 05:23:18 -0400 Received: from www.linuxtv.org (www.linuxtv.org [130.149.80.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56AF6139BC5 for ; Sat, 24 Sep 2022 02:23:17 -0700 (PDT) Received: from mchehab by www.linuxtv.org with local (Exim 4.92) (envelope-from ) id 1oc1NT-009XeZ-I5; Sat, 24 Sep 2022 09:23:15 +0000 From: Mauro Carvalho Chehab Date: Sat, 24 Sep 2022 09:21:43 +0000 Subject: [git:media_stage/master] media: venus: dec: Handle the case where find_format fails To: linuxtv-commits@linuxtv.org Cc: Stanimir Varbanov , Bryan O'Donoghue , stable@vger.kernel.org Mail-followup-to: linux-media@vger.kernel.org Forward-to: linux-media@vger.kernel.org Reply-to: linux-media@vger.kernel.org Message-Id: Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is an automatic generated email to let you know that the following patch were queued: Subject: media: venus: dec: Handle the case where find_format fails Author: Bryan O'Donoghue Date: Tue Jul 26 04:14:54 2022 +0200 Debugging the decoder on msm8916 I noticed the vdec probe was crashing if the fmt pointer was NULL. A similar fix from Colin Ian King found by Coverity was implemented for the encoder. Implement the same fix on the decoder. Fixes: 7472c1c69138 ("[media] media: venus: vdec: add video decoder files") Cc: stable@vger.kernel.org # v4.13+ Signed-off-by: Bryan O'Donoghue Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/venus/vdec.c | 2 ++ 1 file changed, 2 insertions(+) --- diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index ac0bb45d07f4..4ceaba37e2e5 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -183,6 +183,8 @@ vdec_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f) else return NULL; fmt = find_format(inst, pixmp->pixelformat, f->type); + if (!fmt) + return NULL; } pixmp->width = clamp(pixmp->width, frame_width_min(inst),