From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8616ACCA47C for ; Mon, 20 Jun 2022 13:00:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243290AbiFTNAO (ORCPT ); Mon, 20 Jun 2022 09:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243966AbiFTM7J (ORCPT ); Mon, 20 Jun 2022 08:59:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44AE11C10B; Mon, 20 Jun 2022 05:56:08 -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 379A0B811A3; Mon, 20 Jun 2022 12:55:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75A11C3411B; Mon, 20 Jun 2022 12:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655729751; bh=BxlpKTalVEkBk0tBaPAm8eqtVfisQ6VMPRChsYYOfaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mclWt2A5SsWdPkKTMW1iBu5n49IfqAixFqVZe/9baUXnoJZEZd9yOSX0fEFMQmanN X3dQoyCLXmVVEhB9PQAnu/CSWiM9YvgDtWMZxZovd7KYG1Of6djzL0Xs1OEumqTm67 2pf3zAinnEpzkvlRMi5t+RfoYBdPvCsfNal/Nxlo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Saurabh Sengar , Michael Kelley , Wei Liu , Sasha Levin Subject: [PATCH 5.18 062/141] Drivers: hv: vmbus: Release cpu lock in error case Date: Mon, 20 Jun 2022 14:50:00 +0200 Message-Id: <20220620124731.373333892@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124729.509745706@linuxfoundation.org> References: <20220620124729.509745706@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: stable@vger.kernel.org From: Saurabh Sengar [ Upstream commit 656c5ba50b7172a0ea25dc1b37606bd51d01fe8d ] In case of invalid sub channel, release cpu lock before returning. Fixes: a949e86c0d780 ("Drivers: hv: vmbus: Resolve race between init_vp_index() and CPU hotplug") Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1654794996-13244-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu Signed-off-by: Sasha Levin --- drivers/hv/channel_mgmt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 85a2142c9384..073ff9b6f535 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -637,6 +637,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) */ if (newchannel->offermsg.offer.sub_channel_index == 0) { mutex_unlock(&vmbus_connection.channel_mutex); + cpus_read_unlock(); /* * Don't call free_channel(), because newchannel->kobj * is not initialized yet. -- 2.35.1