Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1424984iob; Thu, 5 May 2022 00:27:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzcGjSlvcWMw8JeHC4arM9Mqb37lHDNv4S1zVZRCQ6Jgcx2aourHEwD70uxPJKUQgCLl9d X-Received: by 2002:a65:4945:0:b0:3c2:4db3:ff72 with SMTP id q5-20020a654945000000b003c24db3ff72mr13062988pgs.521.1651735641657; Thu, 05 May 2022 00:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651735641; cv=none; d=google.com; s=arc-20160816; b=LKkrN03fzxNpEFi+eq4lPc1FSyGYfu8FP6gf/Iy6Tk183or/te8nI2siEuphmEcGhX apBMO5WxjU0VlBmC/fr9w0qWlM/DXh6P7D0bKikPoUvf9525ohYDgNx3xdf6JmUNohyS Lj5iW141lceqWiKoUinWaidc+NDyC9jz9X1/9NsHzcA4hxD9/g57qCpuj8fLPhkv/+v9 9xfdHSKIqRPZRxsa+yLrSFHhISnWKNH7DxyPFoTVpq+U5BZVKz7NJbxe+QQQ9rM1KWPv cDHVg2CRU3p+Fp4M0wtk63eE4Hn0kVEOcdyzguw+YHdZ15tPZCDQOL988jtBMoCbFWlq e3cw== 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=PoJtFaB3BMvKGFuWKLZREvzs0C9h+I8bzkCrMY88qHY=; b=kvoiMgq/mQBTApe/qVQ8TqITSQJni+5HGCiV44RgcdqO1rzILzehif77SpqO5wQEUs a+oVrgx6bkE7JpLltYkrK1eEnCD50VhmkvK/sMhc4iHrx3IvqoydCtOGEPArNZVwP1OI a60jGvaP1BTSGdm0Q0B1fSm92sazrbgiSJN6J3t2P3YqqTbw6YvzFK5dGlGHg9xI6NLe E6WGzzfxbQARyfY3Zh61a6AzZdszLDR8MfLbb+K4ogiAuGtrkEv2uIcric6NNGzPK/pp cG1aKVmRHyjXWyZfDUNHET+MYfmrupmC/yXzKKHj+teQLVPucrbRHKgf1aiUomE24GGW Rpnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LcXBsBwz; 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 ch19-20020a17090af41300b001d28b845edcsi1237531pjb.59.2022.05.05.00.27.07; Thu, 05 May 2022 00:27:21 -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=LcXBsBwz; 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 S1357249AbiEDRXs (ORCPT + 99 others); Wed, 4 May 2022 13:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356474AbiEDRFR (ORCPT ); Wed, 4 May 2022 13:05:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 613935131F; Wed, 4 May 2022 09:54:13 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8D2A0B827A9; Wed, 4 May 2022 16:54:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EA53C385A4; Wed, 4 May 2022 16:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683250; bh=nU9hRqmoG+NR1e6QcNT5Gtc/DQw+zQxCB3nckjInEu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LcXBsBwzk2hLfSszzASHxFBSly8+5H/HMXhCO7BxDm0M1fnEdtAr0U7zIEWQqhWqh vY7RWVBpbuMT4RtLt12tNTjvZys62RaA2D3gBSv7gubmNzU2hAjgre6ntYuAmnYKaB zec4ZgwFOuga9niPQOIBu63W1/l4pGoJG2DDGbYg= 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.15 103/177] bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create() Date: Wed, 4 May 2022 18:44:56 +0200 Message-Id: <20220504153102.408014748@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153053.873100034@linuxfoundation.org> References: <20220504153053.873100034@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 4566e730ef2b..60b082fe2ed0 100644 --- a/drivers/bus/sunxi-rsb.c +++ b/drivers/bus/sunxi-rsb.c @@ -227,6 +227,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