From patchwork Mon Feb 26 09:03:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandra Diupina X-Patchwork-Id: 206524 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1966150dyb; Mon, 26 Feb 2024 01:49:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVXz/EQH2kkWd01Jr5YKOVTvUXzuKPsPwVtl0BS3+8N2pUr6UTSZChaUf6kLo4yAGtwzGmXmwnyv6HMkCd21yL5BJyy2g== X-Google-Smtp-Source: AGHT+IEdlzVu/utCmQH0G4VocnlakFjtb3/+way+BSSJ5iAWDuX8kFLKEEvxL05VwPb7E14YLgEn X-Received: by 2002:a0c:da08:0:b0:68f:e051:b1ed with SMTP id x8-20020a0cda08000000b0068fe051b1edmr8400300qvj.23.1708940946234; Mon, 26 Feb 2024 01:49:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708940946; cv=pass; d=google.com; s=arc-20160816; b=bk7NOIf5T3Znkq8GufwxH8OxQTzDwk6o9Xym6+17xeKPb+cUyyiDhLZ0tGgSx8Ixjp nNjdNSP3nTA8aMIQkHVyV0pDVFEno7tFKYSaYyM8HF0wPVuOwzk16xh9FanZnJ3F6EeU gmsOuNGpiwOjhcdjHNj6/dNuzxXGbO9ccXPUR6iYFJFGomBnkk2eVuTPOW7htgsk2xGz T4nJ3N98k3ekarn5dBpXfUq+IZYB7u+JX0g7/sgwaCTYYwsogzbbGE7ghpzQz/hE+/sX 2QPx7S0yqx7Bmh/GMdl06SlZ41cDiyRN5qdYDtVKzeS+bJOIlmfbFa/jTUdlhRuKmzdk +D+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=47wV+gZ5B/0t3R3itRXjkDveN8SUC5BN2X9POFjgecY=; fh=CRR68SeRukQLyoX83ztfu3+YJZ+3u2ScgJMwEJwuooo=; b=CegdgqFwLEP/zU8cVJ5EVAEHkKc5HsQ73prlmv1mzNg8GPXuTvYKfdaCyBt4AFOfGi Q3JOCBOIN3bv9xD3JcUmuWaU5GGEXmOSpn331JAQxqCN+7itZ0r7ZEolcbGKpmpTX3Pb eOXIvgot5R4POfoAfs+FqJbFLG+QfaNBs9HSFG7okypMnHElEwD/TEADgw9BRqQY2xfo C4AdKbTb8bJuPOWMGLMzirPRbgDY91/ivbw0WLfNkSNtXsiDdgIKoQO9bMg5dOAQxlzz 1NtZC6+JP4X1emZnd0XssijGp/XM2JHGoDdCNGXYBYSWcm20AZO7GiHwqpkoN4x6IwPk SMGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=astralinux.ru); spf=pass (google.com: domain of linux-kernel+bounces-81021-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81021-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iy8-20020a0562140f6800b0068ff18d7766si4304592qvb.47.2024.02.26.01.49.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:49:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81021-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=astralinux.ru); spf=pass (google.com: domain of linux-kernel+bounces-81021-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81021-ouuuleilei=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0CAEA1C24C09 for ; Mon, 26 Feb 2024 09:49:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D800312882C; Mon, 26 Feb 2024 09:13:41 +0000 (UTC) Received: from new-mail.astralinux.ru (new-mail.astralinux.ru [51.250.53.164]) (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 93CD422339; Mon, 26 Feb 2024 09:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.250.53.164 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708938820; cv=none; b=jDeqqnpXUVbR7mPyYMZYaNrwdu9QKlc4KgFEXHKFgXGngq1RX8xcKiiDZDlmswLFhahUPcAn0A9Tb5aRgBMFQ7hh6EIf+R8ohf9sY9IqC2FdFF0eVmLfC++TavNCUJEFh6wZ+KiKM8v3IejfdnhZJLLH2c0NrqGoDiSuylPzhV8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708938820; c=relaxed/simple; bh=6Rh0/f6Q0JKY6bLRR8SKhYzN82pnSyVW5t4yFwbYTJE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=LTqcnWcd6FuL0nYQrVgYmR4IFCj6sk7t78tdW9Svi2un/liREwbyHNcjIR9cJ5xCGQa/6AtBSyTXcWynDFgL1JlABu2avpUfRQl3f4qwgZe1v/HrGcZIQgO6ISqQdSSJKgdelrDEgdvxGYFZcmA2upzhaajR3yO6tzu3nPgXuTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=astralinux.ru; spf=pass smtp.mailfrom=astralinux.ru; arc=none smtp.client-ip=51.250.53.164 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=astralinux.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=astralinux.ru Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.232.106]) by new-mail.astralinux.ru (Postfix) with ESMTPA id 4TjvnF43hVzqSN2; Mon, 26 Feb 2024 12:04:17 +0300 (MSK) From: Alexandra Diupina To: Greg Kroah-Hartman Cc: Alexandra Diupina , stable@vger.kernel.org, Mauro Carvalho Chehab , Sakari Ailus , Martiros Shakhzadyan , Hans Verkuil , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH 5.15] media: atomisp: sh_css: check ia_css_pipeline_create_and_add_stage() return code Date: Mon, 26 Feb 2024 12:03:23 +0300 Message-Id: <20240226090323.21799-1-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-DrWeb-SpamScore: -100 X-DrWeb-SpamState: legit X-DrWeb-SpamDetail: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehuddgtddvucetufdoteggodetrfcurfhrohhfihhlvgemucfftfghgfeunecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeetlhgvgigrnhgurhgrucffihhuphhinhgruceorgguihhuphhinhgrsegrshhtrhgrlhhinhhugidrrhhuqeenucggtffrrghtthgvrhhnpeduleetfeehffekueeuffektefgudfgffeutdefudfghedvieffheehleeuieehteenucffohhmrghinheplhhinhhugihtvghsthhinhhgrdhorhhgnecukfhppedutddrudejjedrvdefvddruddtieenucfrrghrrghmpehhvghloheprhgsthgrqdhmshhkqdhlthdqfedtvdeiledtrdgrshhtrhgrlhhinhhugidrrhhupdhinhgvthepuddtrddujeejrddvfedvrddutdeimeegkedukeekpdhmrghilhhfrhhomheprgguihhuphhinhgrsegrshhtrhgrlhhinhhugidrrhhupdhnsggprhgtphhtthhopeduuddprhgtphhtthhopehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhrghdprhgtphhtthhopegrughiuhhpihhnrgesrghsthhrrghlihhnuhigrdhruhdprhgtphhtthhopehsthgrsghlvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmtghhvghhrggssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehsrg hkrghrihdrrghilhhusheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehvrhiihhesvhhriihhrdhnvghtpdhrtghpthhtohephhhvvghrkhhuihhlqdgtihhstghoseigshegrghllhdrnhhlpdhrtghpthhtoheplhhinhhugidqmhgvughirgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhsthgrghhinhhgsehlihhsthhsrdhlihhnuhigrdguvghvpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhvtgdqphhrohhjvggttheslhhinhhugihtvghsthhinhhgrdhorhhg X-DrWeb-SpamVersion: Vade Retro 01.423.251#02 AS+AV+AP Profile: DRWEB; Bailout: 300 X-AntiVirus: Checked by Dr.Web [MailD: 11.1.19.2307031128, SE: 11.1.12.2210241838, Core engine: 7.00.62.01180, Virus records: 12425787, Updated: 2024-Feb-26 07:45:37 UTC] X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791954461692033476 X-GMAIL-MSGID: 1791954461692033476 commit 912680064f94 ("media: atomisp: make sh_css similar to Intel Aero driver") removes the affected code, but in versions tags/v5.8-rc1~10^2~220 - tags/v5.17-rc1~114^2~261 there is no check for the return value of the ia_css_pipeline_create_and_add_stage() function. ia_css_pipeline_create_and_add_stage() may return an error code, so check and return it on error. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 7796e455170e ("media: staging: media: atomisp: Fix alignment and line length issues") Signed-off-by: Alexandra Diupina --- drivers/staging/media/atomisp/pci/sh_css.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index ba25d0da8b81..8502adb75a5a 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -7912,6 +7912,10 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe) out_frames, in_frame, NULL); err = ia_css_pipeline_create_and_add_stage(me, &stage_desc, NULL); + if (err) { + IA_CSS_LEAVE_ERR_PRIVATE(err); + return err; + } } else if (need_pp && current_stage) { in_frame = current_stage->args.out_frame[0]; err = add_capture_pp_stage(pipe, me, in_frame,