Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp658122imm; Tue, 5 Jun 2018 02:12:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJo8B9Fw5GR4ppZsHcbExAwUuUl9KZhdpgq0h75jEVcHD+35DH5jUSkW3HqRNX7pSkAm+MQ X-Received: by 2002:a17:902:59ce:: with SMTP id d14-v6mr26062776plj.253.1528189942282; Tue, 05 Jun 2018 02:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528189942; cv=none; d=google.com; s=arc-20160816; b=MSTqYZ3Ctz8DOyy2e+vDzlTkbKbi1a+0Sldmo4NqTAZXDUZbE3dfin2NbbEGxdorPz L89peAiKb5lcH12Oj14qUOGg3WBTDqtJbYN4qk2sNe3V0RCXefjM2lpU+37t1T87cFij Hrrg18C1VwR7OgGmp1BqQJKgGYv4aWyhb6bI1YUoUeiHdR53e2/SOCWAMKsBeFzpzo72 7mhtAlepHquJICyj+rPqlsE+ODNd7w72njsGn+0sxXm3kWPYOYmbBNE8gmi/M2+7yHch krEpvP8p7UffFjYN9UEdPv9Wmc106PYfWY3PnmrjrIKZXrYhv+XvCRMZh1ekq+HJqLwG wwcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:arc-authentication-results; bh=RA7XzqMWsl7T2KuNMCEEF7VNA1vCuafl92vSz63CQsI=; b=DRVL31a7GY6od1ftx/nlxYy4dxpLJWkLm+xvbyhZ4Eq8rod5wj9Ot2fFY7CkmkbuJj xtyxiEUd6/AzM1joVJdrW2O2azJdB4QvUa8COxvh+Jr8q1BcQHJRJ+z7Muq/CtQFWuXG QXHWtgPKKQx2AAkXp5eR6lLl+JM3B0EBuBcdbrshabhFV9xo4QsJuTBMTTzJDPu7SPnW MuB0fNadEWKyBwlFANyP2aqwpNh/kURN9wMeCiK1DXoD9ofFY3UJuRozy53y6fZ9Rb5A obTbJ0y/Hk1FxEuybFSJcCj4Pj2hiud15FYG0WZtWEpMygi/iLXes4vfilMhxf0IHJDD fbmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd1-v6si5994216plb.338.2018.06.05.02.12.07; Tue, 05 Jun 2018 02:12:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751857AbeFEJKG (ORCPT + 99 others); Tue, 5 Jun 2018 05:10:06 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8691 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751497AbeFEJKE (ORCPT ); Tue, 5 Jun 2018 05:10:04 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5D1DC4DD01E20; Tue, 5 Jun 2018 17:09:50 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.382.0; Tue, 5 Jun 2018 17:09:44 +0800 From: Wei Yongjun To: Frederic Barrat , Andrew Donnellan , Arnd Bergmann , "Greg Kroah-Hartman" , Alastair D'Silva CC: Wei Yongjun , , , Subject: [PATCH -next] ocxl: Fix missing unlock on error in afu_ioctl_enable_p9_wait() Date: Tue, 5 Jun 2018 09:16:21 +0000 Message-ID: <1528190181-15745-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the missing unlock before return from function afu_ioctl_enable_p9_wait() in the error handling case. Fixes: e948e06fc63a ("ocxl: Expose the thread_id needed for wait on POWER9") Signed-off-by: Wei Yongjun --- drivers/misc/ocxl/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index 33ae46c..e6a6074 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c @@ -139,8 +139,10 @@ static long afu_ioctl_enable_p9_wait(struct ocxl_context *ctx, // Locks both status & tidr mutex_lock(&ctx->status_mutex); if (!ctx->tidr) { - if (set_thread_tidr(current)) + if (set_thread_tidr(current)) { + mutex_unlock(&ctx->status_mutex); return -ENOENT; + } ctx->tidr = current->thread.tidr; }