Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4600741pxj; Wed, 12 May 2021 09:01:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfPMx8TOOoNxFKg9/cPv6arRuO/3rJFGUns2CBRSF184zJHEBbPkjpveassgTtV1Ocbw6W X-Received: by 2002:aa7:dbcd:: with SMTP id v13mr43863034edt.59.1620835298867; Wed, 12 May 2021 09:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835298; cv=none; d=google.com; s=arc-20160816; b=W6DbTAJ7fSsbVeOyOYAhadHEbN0Tmkl+tJ9iSPVcwClGDnh/a7V1sf+Z5U+B/3U8Et jx9Mci3EnBOOI+o96RPdncOyJR4jC0Fab9Ly9HPVLl4f9UoMMJhUnA/JAoL7ShZgtvMu LKW1lyD4gTtIQm5vcZYJpXQ7ZQEyQoJubP6dPU/OhEG7S4VwidBJTihZneyD+zLKKM4Z Q1K/OxsaPOsRq7Bh8IA/T7ZhGN+wnTxzNj2TQq1IX6miYilbQDqQItLVG/EQxc0Pc1ly cKe8iH7tcGmznlb0lLhl0ZB7XMDWIPl/QfFfKW2M7A82T4mIxx2Bw/NThE8nASyXRL4q gIaw== 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=Bxa/npHOf6ypi9whLYRWWEA1V4Ba6uvXrkCCiBFiaFc=; b=j5HywHH26IVbqDu0T4gWQP9tli9j8YixKq8UrlVK62S47MUPEVXjkViznfVZVHHv+z glhDUqENK1/vEIkyIXk1mJ+ifXJ8Fmy24vC50LARVC7LqLAUQBtDrqbrpIvOWHKiDLBZ lrnAvs3AwVZx1b4E1BzVHZVIqvVdCvPmkkE89WLyLgbLm0GXR0C1uInNMhWpk2pzXa8k kb0/+hsvF+Yf6Euni4YUnl0LOsM9VRD5SlTqYI9vLs65Lma8BTOqJepjbCN10E56nxm8 cKQutTJmZA8YiHtWaN5yCRX8arnXHud0DiBOxZ7z/Fq2jds1KSLbwIS6khbFXJOU1Qka HcZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GnM5AfXH; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si114851edd.145.2021.05.12.09.01.13; Wed, 12 May 2021 09:01:38 -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=@linuxfoundation.org header.s=korg header.b=GnM5AfXH; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232965AbhELQBP (ORCPT + 99 others); Wed, 12 May 2021 12:01:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:40914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235483AbhELP2L (ORCPT ); Wed, 12 May 2021 11:28:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D14C61925; Wed, 12 May 2021 15:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832395; bh=ypEOU/CNhBtB4MaCH9Ro/6/r+rQI6t1xksKmsj56Cs8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GnM5AfXHK/mssZVbB2gbPAOO51LfoCaySzQeHgA4L5AKq+qzKYoN6PbMIwzko37Vc GLsV4+AZJZl1F1yjgJTEMg33OifKDeh8dj0bhjd76O2k8rAJ/jnlIsWIS4WJIQ0kvN yDBb5lsGUBML4bIMTg+k9TZQE8npV08YnWlfZjiA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wei Yongjun , Mark Brown , Sasha Levin Subject: [PATCH 5.10 255/530] spi: spi-zynqmp-gqspi: Fix missing unlock on error in zynqmp_qspi_exec_op() Date: Wed, 12 May 2021 16:46:05 +0200 Message-Id: <20210512144828.217387913@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit 6043357263fbe2df0bf0736d971ad5dce7d19dc1 ] Add the missing unlock before return from function zynqmp_qspi_exec_op() in the error handling case. Fixes: a0f65be6e880 ("spi: spi-zynqmp-gqspi: add mutex locking for exec_op") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20210412160025.194171-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-zynqmp-gqspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 036d8ae41c06..408e348382c5 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -965,8 +965,10 @@ static int zynqmp_qspi_exec_op(struct spi_mem *mem, if (op->cmd.opcode) { tmpbuf = kzalloc(op->cmd.nbytes, GFP_KERNEL | GFP_DMA); - if (!tmpbuf) + if (!tmpbuf) { + mutex_unlock(&xqspi->op_lock); return -ENOMEM; + } tmpbuf[0] = op->cmd.opcode; reinit_completion(&xqspi->data_completion); xqspi->txbuf = tmpbuf; -- 2.30.2