Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1954055lqz; Tue, 2 Apr 2024 02:51:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/2U+K6frJYqjYhbJ45gsyDiEDJ1bLlsqik5DE4a5cvrnOV/JDS2liWRCX1njzZkDBJSrVw/Cx1DTGVNWxwG5pGf4WOskjObG32Q+vhQ== X-Google-Smtp-Source: AGHT+IGV5BTDf8xb6KA41nxpxHr9d8+sLSrEd6rr5txRPSuvIDNbxOM4l6V0yfW/naQLcGQHQMBs X-Received: by 2002:a05:6830:214:b0:6e6:7db1:b444 with SMTP id em20-20020a056830021400b006e67db1b444mr11816564otb.36.1712051469985; Tue, 02 Apr 2024 02:51:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712051469; cv=pass; d=google.com; s=arc-20160816; b=Eh47vSB1bflIun8Q1G3Hh3ejDOUPbfCb76jPoqdrydD3jqB87g0YeboeQHctxTWYrs fpZoksdKxnXiRnAMUfsmW7dFRyBuqzLGCuCa5+N+3ftTZGaFu0FS9FNLv6UpZCbnW9W7 4w17WWEAzW4KXAAA8VdJV4kmtCW6LgIifA/E1BrKaLx1X5rPLpyrkL70svXMRa43h7Fq 7Ony1qUPi+J8uyhipTevZYj1D7ifnyspggMKYkKnnfXC+/mwwi4PLToqcdZjg0Fogl40 1rB1rAa1Le6hlT5E6WvVhrzrdzW2qe+OxmP4J0DVmr2AJGhy3XOW7cRsH8wtBYAQ+1sV 76gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Q1ZaxICN7ToIIozbqtvOwNxujfW1ijdhvFxXA7sozGs=; fh=H5kXqGb/CJaUSxsh+vlGVdk704x9BTjKppdpRw25vAQ=; b=q7C+WdbiQUALWxpM/qROcOrDFW2DSFJ8xn6JpN0jF9WNnz0LAzrSfZUvXVOxrx0K/f TZpdnUleIGg96s8RAhYjLDVgfKRetXOwv5pIjVBrarbfGem+U3F2EIXspMIGrTYpCoXe Cpk60Ht+cM9C6n28ZrWvU6p77BNXgYzZJ53uvjxkUHPJ2N3iDdCxqkLd1S0l8jVHgvvJ CJCMrqjGsSlbChdW4U6RQjtTHIh5ajqeEI7lVY3ZSobw3MV/DzaJTMqpTXfQnmvaOQ4n gZLZLSqJyzi6gV72zAfvZN8TfjO2vJ3wbAKuiC9p4NB56Y0TrV9u38b0brzo40aDs7x9 Gk7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=35rLm1S5; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-127661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bs187-20020a6328c4000000b005f0be963c55si4200681pgb.394.2024.04.02.02.51.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 02:51:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127661-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; dkim=pass header.i=@collabora.com header.s=mail header.b=35rLm1S5; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-127661-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127661-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 A258B281820 for ; Tue, 2 Apr 2024 09:51:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC9E55914E; Tue, 2 Apr 2024 09:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="35rLm1S5" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 410DE17C8D; Tue, 2 Apr 2024 09:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712051459; cv=none; b=IpGQ7kY39cna5b8FLxSI4O7VmzFcxuOn2G/jftzZ6ANgZf/dZx6uWA6znTJ5xD3k750Ue8SAykbM7YFMzppASffx5QypaUfh4X8WBIkTSMjzxm9PWoo6ICi6+jB42KH6+fnNyjybeQEN1ss2A82T8jGdCfH196S8QYbBiDhscyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712051459; c=relaxed/simple; bh=vw9cJNl0LdiDuqpsolVN3qVEokjCyQNhVMfH1BeHA1Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S73zKO9AyYUvIDvL4C9wU0IjDnGXSV1DfvXoV1akSCHaiRHplx+KLLYMmSUbOPPRW8sK6brM3cQImMT6zhqpiPVo23T/bvf71A/+8rSmM/UBesmYhD5OxgILHURqXlXjLPbZ+1GtLLSX+EtI+HGu0ChrJBVGryJrXOoMp3BYjBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=35rLm1S5; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712051455; bh=vw9cJNl0LdiDuqpsolVN3qVEokjCyQNhVMfH1BeHA1Y=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=35rLm1S57yMgRE+kXJmLpYmkm6SUggu4hiypnYM7pxO4Qzz9MUkxoEoG37wJDSR6Z I8BjXG4rZv7tpL4/HMeydnOgGt0ywMPEuDn11KRvHZRlJA7NhpvZfYTrjiV5/T/m13 2HD16VV0x41MOn+n1To3JOlICC43sCB0n0bH0hAIRBSAvH16r+yKjZi8o+m/+mavOx 69yABYjYrxphibinRyMHdWhSbfS/EbQaN0yWq2DFey5Kd4xJVO5OEDRCqDu9CYTVIe gVnRQusPVg3hFVlyOBPtEtBJdiqTGIwN2X4A4JUTkh2jWt+y+9xfXbF3M4ah0i0/gZ mXMBr2WexXVpQ== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D7B0737820EF; Tue, 2 Apr 2024 09:50:53 +0000 (UTC) Message-ID: <4949bd54-8c32-4490-ab19-d38796d29ac1@collabora.com> Date: Tue, 2 Apr 2024 11:50:53 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] media: mediatek: vcodec: fix h264 multi statless decoder smatch warning To: Yunfei Dong , =?UTF-8?Q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , Benjamin Gaignard , Nathan Hebert Cc: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20240229095611.6698-1-yunfei.dong@mediatek.com> <20240229095611.6698-2-yunfei.dong@mediatek.com> From: AngeloGioacchino Del Regno Content-Language: en-US In-Reply-To: <20240229095611.6698-2-yunfei.dong@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 29/02/24 10:56, Yunfei Dong ha scritto: > Fix smatch static checker warning for vdec_h264_req_multi_if.c. > Leading to kernel crash when fb is NULL. > > Fixes: 397edc703a10 ("media: mediatek: vcodec: add h264 decoder") > Signed-off-by: Yunfei Dong > --- > .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c > index 0e741e0dc8ba..ab8e708e0df1 100644 > --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c > +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c > @@ -724,11 +724,16 @@ static int vdec_h264_slice_single_decode(void *h_vdec, struct mtk_vcodec_mem *bs > return vpu_dec_reset(vpu); > > fb = inst->ctx->dev->vdec_pdata->get_cap_buffer(inst->ctx); > + if (!fb) { > + mtk_vdec_err(inst->ctx, "fb buffer is NULL"); > + return -EBUSY; > + } > + > src_buf_info = container_of(bs, struct mtk_video_dec_buf, bs_buffer); > dst_buf_info = container_of(fb, struct mtk_video_dec_buf, frame_buffer); > > - y_fb_dma = fb ? (u64)fb->base_y.dma_addr : 0; > - c_fb_dma = fb ? (u64)fb->base_c.dma_addr : 0; You're changing the behavior here, can you please explain why this change is valid into the commit description? Thanks, Angelo > + y_fb_dma = (u64)fb->base_y.dma_addr; > + c_fb_dma = (u64)fb->base_c.dma_addr; > mtk_vdec_debug(inst->ctx, "[h264-dec] [%d] y_dma=%llx c_dma=%llx", > inst->ctx->decoded_frame_cnt, y_fb_dma, c_fb_dma); >