Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2198911iob; Thu, 5 May 2022 18:47:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1zUdFoelmLIOR8COcIRW/YPppPjPnPkNC6iZ49tQT3vs9qxK1Kb4edwSJFA+GtWAtUJqC X-Received: by 2002:a05:6402:354d:b0:428:19be:2447 with SMTP id f13-20020a056402354d00b0042819be2447mr1081602edd.308.1651801652745; Thu, 05 May 2022 18:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651801652; cv=none; d=google.com; s=arc-20160816; b=ds61bocVDqUFuvhRB6zcmks3Fmoprxj1fIAW15voWNosYXKLwlZfp7A8zsN7hCIQ01 KJjNCChKg+1/mHoT4blccZhv7GXYayR7rv9eMq7G8NcjaGuflKb/pNwtkmkDG73ChHvn VJmc6I3P0FWirOmf4obXvNOqnxgRuGQZIQVkpVFpU2YYaRCM+vbVVQN9XHlF1h6rXmEq 2D5VaoHVxvzz7psxdmEZxTqXdOTWsvVAofuy8UxWQEtpysqugx+ca3NWEmqKqsVxL54k PnE1/OGN8Gc/8tFu9xIeE2khYzqLjQYjMBdQSdc5+uI7devBBX5z2bI72AFazjofyQRb kreA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LRtmZpShVQde3lb50GvC1zcMnEcHb7cKkpwxeyM3Tvs=; b=rl2xqcU6yr639paKuKnKIb65XdgMl7xzRYkPQE1D9nAFT7m+kkqdPhmh9InrLXyg/Z QMxoIOI5YDWldowaJIZMNWdzip5OmRiIc21lpWE0EXDd46OZMj/PY4UXLMRsxZf+TTu1 vmGt5/rh4ExUHtjXz7AabwmCu4S4eqVAlPHVGIbgTRTh/9lr+PrzmvSlr84quqtTHigY kZ25EaR7ulNO6k6C4BRcDXbSHTbLtSQjsWVm2NzEzVrwQM2w+47S2Axt93PTUGA3VFb7 twcJXBZejsbRl2TDB9lfgfkvbhF1/Vw6AEQsvllNX0rkfoPzbrJazzTj1wgLpwL3U7uY 1J5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P1PMh5cj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he13-20020a1709073d8d00b006f38feb351asi5348940ejc.495.2022.05.05.18.47.09; Thu, 05 May 2022 18:47:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P1PMh5cj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355571AbiEDRIH (ORCPT + 99 others); Wed, 4 May 2022 13:08:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355513AbiEDRAH (ORCPT ); Wed, 4 May 2022 13:00:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40AF84B842; Wed, 4 May 2022 09:51:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CAB21617C4; Wed, 4 May 2022 16:51:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26292C385AF; Wed, 4 May 2022 16:51:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683093; bh=QYfJ4jy1pgwenIxzQh04z03IUEVKov1C1SpEawfBfwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P1PMh5cjx202KBHVzpbHXQIRJMgXpRIMKxPPuPKdMN5/DZJnRSBDyDeZSZGVfHtex V3zXbyg0hu7AuSX8keGpUgiClJ14El19fKMgUyufy8lzdq7eRntpL0nZ7h/EC4iiHp r45O1eu4o7xQESYuSwwkh7nAXpORdOxOzu53QsEs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Samuel Holland , Jernej Skrabec , Sasha Levin Subject: [PATCH 5.10 085/129] bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create() Date: Wed, 4 May 2022 18:44:37 +0200 Message-Id: <20220504153027.785752326@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit fff8c10368e64e7f8960f149375c12ca5f3b30af ] This code is really spurious. It always returns an ERR_PTR, even when err is known to be 0 and calls put_device() after a successful device_register() call. It is likely that the return statement in the normal path is missing. Add 'return rdev;' to fix it. Fixes: d787dcdb9c8f ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus") Signed-off-by: Christophe JAILLET Reviewed-by: Samuel Holland Tested-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/ef2b9576350bba4c8e05e669e9535e9e2a415763.1650551719.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/bus/sunxi-rsb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c index 1bb00a959c67..9b1a5e62417c 100644 --- a/drivers/bus/sunxi-rsb.c +++ b/drivers/bus/sunxi-rsb.c @@ -224,6 +224,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb, dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev)); + return rdev; + err_device_add: put_device(&rdev->dev); -- 2.35.1