From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C8D4C8486 for ; Thu, 27 Oct 2022 16:59:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D753C433C1; Thu, 27 Oct 2022 16:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666889959; bh=e77SltMDh3N1oIHPnyPOIz17JKzpmxa4gY5v6TOWUt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=th0bCW61jVQly6873syH7GPiXnFPS1bXBu4poR8U+4hD4U69xVsZQVHwp7GDhNhQ3 2ABfX5urU5oUutGIwaRknTMh1c5e4PbkQscQHIG39pOc6jAl5vyPSeEUgV/mykn3J6 rd5kWPj5jouD7eIiknv7dtWDYtK4v4vfLBpnVDzU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bryan ODonoghue , Stanimir Varbanov , Mauro Carvalho Chehab Subject: [PATCH 6.0 23/94] media: venus: dec: Handle the case where find_format fails Date: Thu, 27 Oct 2022 18:54:25 +0200 Message-Id: <20221027165057.996118543@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221027165057.208202132@linuxfoundation.org> References: <20221027165057.208202132@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Bryan O'Donoghue commit 06a2da340f762addc5935bf851d95b14d4692db2 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/qcom/venus/vdec.c | 2 ++ 1 file changed, 2 insertions(+) --- 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 *i else return NULL; fmt = find_format(inst, pixmp->pixelformat, f->type); + if (!fmt) + return NULL; } pixmp->width = clamp(pixmp->width, frame_width_min(inst),