From patchwork Fri May 8 12:32:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86D42C38A2A for ; Fri, 8 May 2020 12:41:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DEE721835 for ; Fri, 8 May 2020 12:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941716; bh=JFs8PvW9Eaksh19MTes//uc/Fb1GBekhhNjYYonSPtE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oQoDzjIpogxbVi8zrM1yaQlBKkT82d9GI6kdKpyyHmg0alp7S2gGWEUeCjCku05ll FShOH8sBboi+i5EF2ufVpNBgerS++THD1JgaYigv4l7L/NxF+WSxTy1/DIMkQPxiI0 ecNeOPE3hORicu/dxMECsU3lrM/Cbk1rlSm2lr70= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728878AbgEHMlx (ORCPT ); Fri, 8 May 2020 08:41:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:37726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728876AbgEHMlw (ORCPT ); Fri, 8 May 2020 08:41:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E29272495F; Fri, 8 May 2020 12:41:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941712; bh=JFs8PvW9Eaksh19MTes//uc/Fb1GBekhhNjYYonSPtE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UGoLiEZs5D7VTrhFVO2ubrmoix/UQaiuqhAL2ZZJ+DNiHHtZ8iFX5RGDhCEQqptTo POpLBfzzPOE5NCcZlqJdehfyGqO36gUpJzX1h+UuGYE6zUZJMVlH1BwCuX1qTah9Go sWLU3flyp+prMdJfpnCPjuAjvrQjiaCmARWpmBw0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olof Johansson , Grant Grundler , Ulf Hansson Subject: [PATCH 4.4 141/312] mmc: block: return error on failed mmc_blk_get() Date: Fri, 8 May 2020 14:32:12 +0200 Message-Id: <20200508123134.397412537@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Olof Johansson commit f00ab14c252ac459e86194747a1f580ab503c954 upstream. This used to return -EFAULT, but the function above returns -EINVAL on the same condition so let's stick to that. The removal of error return on this path was introduced with b093410c9aef ('mmc: block: copy resp[] data on err for MMC_IOC_MULTI_CMD'). Fixes: b093410c9aef ('mmc: block: copy resp[] data on err for MMC_IOC_MULTI_CMD'). Signed-off-by: Olof Johansson Cc: Grant Grundler Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/card/block.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -668,8 +668,10 @@ static int mmc_blk_ioctl_multi_cmd(struc } md = mmc_blk_get(bdev->bd_disk); - if (!md) + if (!md) { + err = -EINVAL; goto cmd_err; + } card = md->queue.card; if (IS_ERR(card)) {