Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp122226ybg; Mon, 8 Jun 2020 18:13:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx13vber1SRJS36RoNfqmSCmISkX5NM0Hg8cxFJrDnxCkCLG/U0ALgFP2BOVCv2u869ZJkw X-Received: by 2002:a17:906:689:: with SMTP id u9mr22496043ejb.13.1591665230849; Mon, 08 Jun 2020 18:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591665230; cv=none; d=google.com; s=arc-20160816; b=q9RVvPKXxWWsUekC2GpfbycRinwTfy+di/JWEGtci44NED93sXDO8jtPEJEtesXHZJ EWg048qQRe8NHeIRGFXb2kolBfqo1I1YKVvBnstS9wcpD6RMPlLfI6dzmHFf9kzyl9C9 STsx98SYIm2bUjB9h5vhswYdsVrnk4gEogKXG55v3SVuJm+5HA6GfzzNfDoBQmZ7bwMQ 6VtByv9uLPCkI3WWSsCObpsZqqC/vXuOTcnK0QZMRgemXzlPTSyurvj5uYrz/XtfFnKy mjOkWFITP4c+j25DUTrpGa0BML2EYwJtMzqZSookMwo4xkK1qRdD8o05YC70Jxgpm54E z8rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jOxzp/G1+iNtbk8OpGSmvIjqufZXkvjVz+C49suTjNc=; b=bw2c9QuBNX3KHucJbReqEGvGLFuR3LYdCdC+DcKRcVKfmn4BRcvUjLYu2UU0kOL25F Ey+GJkQTksAyenAVJzYkVXMVgxrQgZzYkc/dXThm89qx1MqgJ8UqhuF5GikdXn14Yt1A tPdCiRiwKxP8pf9BhEm/2D7f7sRKWWVqd05v64mBoAMVfKETgsGkCrdZ2rNJ8CXlWumv NOvwpbIqYwXR9fS7gWj5ia0JZdHhVQScHaN1IziXBQ0NkDGHbO89V/kYuQbjW4obtkRr q7x0/bI3lTm3cKQtgyHsuMIRVHYcoGeGuFD1QGRO7ZxLlajGy9iXDssdwqL2AQuyJ1Wv aI0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A5QyrQpo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si9687371ejr.283.2020.06.08.18.13.28; Mon, 08 Jun 2020 18:13:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A5QyrQpo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388239AbgFIBJu (ORCPT + 99 others); Mon, 8 Jun 2020 21:09:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:49386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726961AbgFHXGY (ORCPT ); Mon, 8 Jun 2020 19:06:24 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 668D920774; Mon, 8 Jun 2020 23:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657583; bh=RfN7e+IqfNDAX+YUtjar6zUcVJXwkRCwxqE082RR7Yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A5QyrQpoGQ9sNl6Fa+BgTAVKlgiP2UtyIkh8Pc21Ku2c/G3rJFVoMd55lFACXKWYX XsOdeJYzh3sfBVlqkS3Bh/EtpFh8RJHqoVdvcjHjwqNaVekvUMFY8xrFy8phXGOj8F 0uqGlOGwxGT9Vt4WaKlA1sLV6Tk9iRJEy6aWBqVI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 012/274] media: vicodec: Fix error codes in probe function Date: Mon, 8 Jun 2020 19:01:45 -0400 Message-Id: <20200608230607.3361041-12-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit f36592e7b343d853edf44d3545bb68961c0949a4 ] If these functions fail then we return success, but we should instead preserve negative error code and return that. Fixes: fde649b418d1 ("media: vicodec: Register another node for stateless decoder") Fixes: c022a4a95722 ("media: vicodec: add struct for encoder/decoder instance") Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/vicodec/vicodec-core.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c index 30ced1c21387..e879290727ef 100644 --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -2114,16 +2114,19 @@ static int vicodec_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dev); - if (register_instance(dev, &dev->stateful_enc, - "stateful-encoder", true)) + ret = register_instance(dev, &dev->stateful_enc, "stateful-encoder", + true); + if (ret) goto unreg_dev; - if (register_instance(dev, &dev->stateful_dec, - "stateful-decoder", false)) + ret = register_instance(dev, &dev->stateful_dec, "stateful-decoder", + false); + if (ret) goto unreg_sf_enc; - if (register_instance(dev, &dev->stateless_dec, - "stateless-decoder", false)) + ret = register_instance(dev, &dev->stateless_dec, "stateless-decoder", + false); + if (ret) goto unreg_sf_dec; #ifdef CONFIG_MEDIA_CONTROLLER -- 2.25.1