Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1672258pxb; Thu, 4 Mar 2021 18:15:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2+jT84l8JJLUZGenXJooOy90PVxP1HJbEjN7HQwO9Aq83CQSgSXKgqiFMpaDd7mIJI5Eb X-Received: by 2002:a17:906:644f:: with SMTP id l15mr362512ejn.229.1614910552682; Thu, 04 Mar 2021 18:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614910552; cv=none; d=google.com; s=arc-20160816; b=Bd2pmpfnPYLFjDswDgYSDCkMBjwMVscuR2NuXQhGwdipRpne/Iwj0hJ0VoVN7m7zrQ +hbwSNIqCONLah7j23oQnH43HGSrHlIOhR2hP3nzDv0rygLCOEEgBwJmctncNuWJSPd/ ZVmx0lyQfhPy8QM2P2kDwX0tP0xdT2J0TVN08f2P6g85jHA3tYt/l89q42yvfym3Mvfi vZ+QZwtQC2uA18CkRzwbskpTDYXn1JWKDhPmDQQU3NNk5Ll+Mu6zF7BvtJZ7/rTM8Faj O0a3oB1RkIyGJU2OJIS4CQNuCxKwuzdyo/vJzDSmHaAXSEzH9NlDWn0SA9sKof+M1JkV 4ZBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=ehB5kuf6nm51L8XPj/urF4pDdDtfNb9caSakFu4ip0g=; b=p+m0rgl9clalZdd3Kx+nxHQAvCFzz1gUT3IbU/ilZGYUbUVooSBgdaQxz1cUoGKUhB megZm67oGyGiwLvogSvlATdv/sDTvxA9CVfCdRbW8q6JTYQkMRaHMHHbXo2w6gt931Lg 3m2SZ7PeM+z0mU0yb3AT6kQI2UDYvsytvVwWmhBaIima3WFj/EaU/mBOFBjHxML0MKSG vjrg3bOb/+Le3vWdF6+R+ooOKpdnqLLTG2WE9zYvzA7lKVs1ucEHc998qgTui2j5yPYc 5NXllaymIdjgO9EKpqXiv99/lFOmuNvC/PTrhjPXttnLr7Tfknh63yFWFUeEiureSwje 6m4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k0giN0CR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j26si530987ejs.484.2021.03.04.18.15.28; Thu, 04 Mar 2021 18:15:52 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=k0giN0CR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbhCECO4 (ORCPT + 99 others); Thu, 4 Mar 2021 21:14:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbhCECO4 (ORCPT ); Thu, 4 Mar 2021 21:14:56 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96C91C061574; Thu, 4 Mar 2021 18:14:54 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id t9so901981pjl.5; Thu, 04 Mar 2021 18:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ehB5kuf6nm51L8XPj/urF4pDdDtfNb9caSakFu4ip0g=; b=k0giN0CRygTS1I+wxcxaONR5lWWUuDwmWJfWpevbjb5IIWi9qeWk6gaQ6T2scG6rmK RqReAobS2LAY1rpCsqOk1pSIX5gl7Esaimjg9AnG6dLsabY15Fnz0JcGLY/WatP3LNKm xyNKFaJnjsPBi/tbbVjqwJklosdXjrRDxaWxI2qbckoTY+uKcyH4opTN77/1AmgFpNmT TW+wC7lAUWBZeVxzm+L7TQrnrjROjDCmmPx4RmaF/iCX4kvLi2IF7DC5P391L6TwsdPP A2KS0aJPNlYOyrKHzIRcSuf65NVcfAYYy7lE3GpBh8m5CyC4ySw/ZgKyVq5UbD2wEES2 RNxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ehB5kuf6nm51L8XPj/urF4pDdDtfNb9caSakFu4ip0g=; b=MqZmSTwVmUADk9EipzlF0Dt/OPpKThu6+sZvbSQmOKyUHbZoyZanZy7k+/31PrDxtM GOl/u4gblklzM112qINsXyAPP0DJqzwGQ6ctb9VLQA6Q1Jib5LVQmpskTARoA/3kr10/ IIIFynVrcwMiLxNakwyM/J45K+al8D22NHWqsIfHV696/06na7AvJWQx0MeyK3RtaQEH qaA/b8HLLz32tDKIsysmB0F44sPbOog2LXkBIPtiLkLFibX/3XHP7vvAjVRo3t7seq4q 7afWTRusNAzj2XAt6SuDSMmofT8RYAZH8fyKDrMVgemZtAhcDOyCxAO0RX0cGszUmI5l 8w0Q== X-Gm-Message-State: AOAM532C2SQZUkbncwxRy2ETES3mJC4rDmDYOKFleAZw4++cL7NNt62K mThuVbNjAs/wNA/TUIdKr4o= X-Received: by 2002:a17:90a:4598:: with SMTP id v24mr7768528pjg.102.1614910494078; Thu, 04 Mar 2021 18:14:54 -0800 (PST) Received: from localhost.localdomain ([45.135.186.46]) by smtp.gmail.com with ESMTPSA id bb24sm488674pjb.5.2021.03.04.18.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 18:14:53 -0800 (PST) From: Jia-Ju Bai To: maximlevitsky@gmail.com, oakad@yahoo.com, ulf.hansson@linaro.org, trix@redhat.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] memstick: core: fix error return code of mspro_block_resume() Date: Thu, 4 Mar 2021 18:14:45 -0800 Message-Id: <20210305021445.3435-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When mspro_block_init_card() fails, no error return code of mspro_block_resume() is assigned. To fix this bug, rc is assigned with the return value of mspro_block_init_card(), and then rc is checked. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai --- drivers/memstick/core/mspro_block.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index afb892e7ffc6..cf7fe0d58ee7 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c @@ -1382,7 +1382,8 @@ static int mspro_block_resume(struct memstick_dev *card) new_msb->card = card; memstick_set_drvdata(card, new_msb); - if (mspro_block_init_card(card)) + rc = mspro_block_init_card(card); + if (rc) goto out_free; for (cnt = 0; new_msb->attr_group.attrs[cnt] -- 2.17.1