Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp86954rdb; Thu, 21 Dec 2023 03:43:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXga+QTH2hwcTRfFacsrxBkeqgrui817hhgjxJW7FSwtGDNxMq1AzeVydPLiuET1wp7UGH X-Received: by 2002:aa7:c697:0:b0:553:a376:9341 with SMTP id n23-20020aa7c697000000b00553a3769341mr1153296edq.155.1703159002739; Thu, 21 Dec 2023 03:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703159002; cv=none; d=google.com; s=arc-20160816; b=y40a5Uf9z1LmIFLWbzHr7ZSWZmQCeY49fkTpesj90ljlZPCcx/T+S9AopaeNZf0Mg3 tgH8RYUcpii2h+OlEmUcqGa1bB9B6FkXGzq2EYqGfyoBGtXk/F/+fUX/ExHatyWch+ac X2zaOBOf7erhcD7ojoVCi8oqhiWBDrtvEyeKoFZM0UfuUIAZk1jaEZxjOCDLKfOwwjcj UexfVFwUVjaurR2zOjGblNEjEyAKthMK/cI49CsSm8Ny09g3DiaRFLKjDf3RAVhlqiuv 53GOyuNmIx49YGaNZ/YMuc6r4pJoQ+ERfNB17+tg9SJQuCadHQqubmEn+o3jUP7ryrND LPaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=OuyovJIVMpz5u48/Av45UHTPjF0RanaFo8uIYsvWi8s=; fh=MIdwjH+G1ULgJAJbTpg6RIowp/YSA71HBqSmxSR0kDw=; b=ML3FQTuDta2zaGkph5SUallJtesBMBq3G0opWLOeIjqitrcONcvzB1CHuPXYrZMf0h nRn7RLWc12YnD4yu+gbeB5eU8T0VzvxaoGu81DfCRuyZIFZQY6vX2umbGpZPfA/6GqUN 3NyV5N6opacMvwUI3PTLf3Md5uudcJ1Tms06IbHFobQGm2wjf0K0+zlvtBojSwM8+/IM +Sz+McUCSd4vJL6bUIPfW9VM6lbMZ+yfyoOgzQSFJv3dNanp/8H/tUBdmv90y09otXQy fOlNd25RJdAgGZnPMbS5J8qXjljamvLiKp//rXlBCFXqC33QR6KBhGxAUaBmNrXT5I99 4o0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TFM05tf5; spf=pass (google.com: domain of linux-kernel+bounces-8299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id eh16-20020a0564020f9000b005539faaa6d2si754307edb.211.2023.12.21.03.43.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 03:43:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TFM05tf5; spf=pass (google.com: domain of linux-kernel+bounces-8299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8299-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7CBDA1F25775 for ; Thu, 21 Dec 2023 11:43:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB93B6E2B3; Thu, 21 Dec 2023 11:43:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="TFM05tf5" X-Original-To: linux-kernel@vger.kernel.org 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 C37F31DA3B; Thu, 21 Dec 2023 11:43:09 +0000 (UTC) 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=1703158988; bh=Ooyo7cFIzcwmmqODzrdGSMJ0PnUsddzGotcXVunWRCw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TFM05tf5xJkbcJ5fK+qrJ+/xhaHuaVmjqxZtkCf6cdSJQAqC4cLGxctKfwlPGPKNN SD5/G6nie/n/3szGdDCTnMaTlop4alnGMC0YqrOpVil47QEw605kL7fknTx+mkFUZH a5jAfz/3KKcym43ySHes4MqKmwz4l9i1831yMbDIIcLgKr+o4q587s1H9+vmhOYK82 bUVhYYObnb2fYERFLOwreaFSJyTyroAtCGB+33HFuuoWu/VSHzBrlvtFCGmwbEOItd lX5I/KoatFr56yhZz3M9WZJ5T2j7OM4To9gsMW8v3201z3pUjhcF8/Unkd/BhOucNO 0RKX9tB/YS4rw== 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 2866D3781FC9; Thu, 21 Dec 2023 11:43:07 +0000 (UTC) Message-ID: Date: Thu, 21 Dec 2023 12:43:06 +0100 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 v2 3/4] media: mediatek: vcodec: Update mtk_vcodec_mem_free() error messages Content-Language: en-US To: Fei Shao , Hans Verkuil Cc: Andrew-CT Chen , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Dufresne , Tiffany Lin , Yunfei Dong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org References: <20231221092226.1395427-1-fshao@chromium.org> <20231221092226.1395427-3-fshao@chromium.org> From: AngeloGioacchino Del Regno In-Reply-To: <20231221092226.1395427-3-fshao@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 21/12/23 10:17, Fei Shao ha scritto: > In mtk_vcodec_mem_free(), there are two cases where a NULL VA is passed: > - mem->size == 0: we are called to free no memory. This may happen when > we call mtk_vcodec_mem_free() twice or the memory has never been > allocated. > - mem->size > 0: we are called to free memory but without VA. This means > that we failed to free the memory for real. > > Both cases are not expected to happen, and we want to have clearer error > messages to describe which one we just encountered. > Update the error messages to include more information for that purpose. > > Signed-off-by: Fei Shao Reviewed-by: AngeloGioacchino Del Regno