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 6F03F1F130E; Tue, 3 Dec 2024 15:05:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238329; cv=none; b=oAv1Pp5Fd97cgmUqB5bw3OS7ZJf7r09jw3vSBSqzfnJnS/3jI2H1JEROaHZ2aeDu9xUnDZoq4wXr9Z7naURi3+K2+bu9wwBvLstbZhtRErki6+CNeZHj8RlVKIp7z3vAJ/6ccDHoWDsOKEdG5HE8sCuqMHIcrL8jrBJeE0i5B6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238329; c=relaxed/simple; bh=Xbj/6BoB6sNe01sqMKmRgtfH0dme84auy2T6y03IuJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YypFDAocPbvPtVjuoQnoFEO/7lp5OXhZlC2PCajflwSUU07nqt6JU7s46hJ37bP17aUpGU2AplhdMPCa9+PdSoLGhA+QkzsH3ykK+fPDmXohPIVNsTDOGy3F0WtqOjwqlb3WYK52eYRqUAFjOC1N/E1bxKMNyh7R3SasXeagiMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BIxoJJji; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BIxoJJji" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EF79C4CECF; Tue, 3 Dec 2024 15:05:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733238326; bh=Xbj/6BoB6sNe01sqMKmRgtfH0dme84auy2T6y03IuJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BIxoJJjiS3Dsb8KnWFXzczmRZqje4gjs8P4z0d3i6iCOn7U99k5FP4J/1BVNvECr8 HBuamwJ4/6npsdpHu8vjaDk3j8Uv+fB564TxCCq8ILBlbMKeKMwLV0MG1rqCNgu3WJ MDYBIk7JtyVsJr4yzquQan/GI9EpaDNKTi83bOe4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Li Huafei , Andy Shevchenko , Hans de Goede , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 6.11 210/817] media: atomisp: Add check for rgby_data memory allocation failure Date: Tue, 3 Dec 2024 15:36:22 +0100 Message-ID: <20241203144003.943768267@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203143955.605130076@linuxfoundation.org> References: <20241203143955.605130076@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li Huafei [ Upstream commit ed61c59139509f76d3592683c90dc3fdc6e23cd6 ] In ia_css_3a_statistics_allocate(), there is no check on the allocation result of the rgby_data memory. If rgby_data is not successfully allocated, it may trigger the assert(host_stats->rgby_data) assertion in ia_css_s3a_hmem_decode(). Adding a check to fix this potential issue. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Li Huafei Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20241104145051.3088231-1-lihuafei1@huawei.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/atomisp/pci/sh_css_params.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c index 232744973ab88..b1feb6f6ebe89 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c @@ -4181,6 +4181,8 @@ ia_css_3a_statistics_allocate(const struct ia_css_3a_grid_info *grid) goto err; /* No weighted histogram, no structure, treat the histogram data as a byte dump in a byte array */ me->rgby_data = kvmalloc(sizeof_hmem(HMEM0_ID), GFP_KERNEL); + if (!me->rgby_data) + goto err; IA_CSS_LEAVE("return=%p", me); return me; -- 2.43.0