From nobody Mon Nov 25 09:58:07 2024 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 1E31713D539; Mon, 28 Oct 2024 14:21:13 +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=1730125274; cv=none; b=ogaIZIuczml7zhdvJrTGpD9QX/kov9eXpIadYm4z5/SQGu1PHtYkmohjUIZQZNMF7X+NQZeH6/zTaFl9/Z5MAtEQFrQ5VtvW39rMXHZLSVx4WPROI08hv6jbiCX3NQWcZk5wlGb+L2/gWHFSKrAjSVQ4MPUqfs5LgjWeLp2D9MQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730125274; c=relaxed/simple; bh=QhoMOA3thfyYMlJZ9ETgV6sjVHnxZtN6xzc280Q27bM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=OVSCLLjlmzKAXu3izSs4EJKaozzxeQTVsBOCqw3p/b+wNST9/1t98SC4pZCytrmJcrspvjKDQDsZKeyXNcqlu5+ik2eRb6hqB/NVcbB/vqE9sV53In0KPWa61oLUAVFogdDIWwXJkcBettbcXTv7Bn75KTcQJgPW0B+A8HjM9q0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O2sTa4fZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O2sTa4fZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C147DC4CEC3; Mon, 28 Oct 2024 14:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730125273; bh=QhoMOA3thfyYMlJZ9ETgV6sjVHnxZtN6xzc280Q27bM=; h=From:To:Cc:Subject:Date:From; b=O2sTa4fZmpqnas6xA7rb8gKMCrNDrD7WUHZOkFUSYa/tkykEawdP12GkAvHsly/Mk Oqh4a0qoeN/jEa0A4RJCGPUEUjf074pmO/0TX4i6Y6EKzZEs863WoUCREV4ZfZotlr NpEYLQwfJPx7gosnM1BZnx77re0aLfrow4H1MdMYk4zWtWqz3K7HjI5Q1dje3Z6mQd WOEZFPI+6gxVqCRIjuOIl9Zz9bG9irIrGkBZoGGQAPdpk/xib8M28e9OTPw8VP4Acz ZeGR/4/c98V/ur/B2anzTNKB8l/MyKTWQ8TfGQ95A0mIABdjFh02Pb6NdDIwaz0tWI KCIgwMOCOYCkg== From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: Arnd Bergmann , Hans Verkuil , Zhipeng Lu , Ricardo Ribalda , Dan Carpenter , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: dvbdev: return -EINVAL on failure Date: Mon, 28 Oct 2024 14:21:03 +0000 Message-Id: <20241028142107.737053-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann The dvb_register_device() function can return an uninitialized error code: drivers/media/dvb-core/dvbdev.c:554:10: error: variable 'ret' is uninitiali= zed when used here [-Werror,-Wuninitialized] 554 | return ret; | ^~~ Change this to -EINVAL as in the other half of the #ifdef block. Fixes: 972e63e895ab ("media: dvbdev: prevent the risk of out of memory acce= ss") Signed-off-by: Arnd Bergmann --- drivers/media/dvb-core/dvbdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbde= v.c index 78f46cb47c84..8c8dc7bbc59b 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -551,7 +551,7 @@ int dvb_register_device(struct dvb_adapter *adap, struc= t dvb_device **pdvbdev, kfree(dvbdev); *pdvbdev =3D NULL; mutex_unlock(&dvbdev_register_lock); - return ret; + return -EINVAL; } #endif dvbdev->minor =3D minor; --=20 2.39.5