Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1115140imm; Wed, 1 Aug 2018 10:25:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcrGoxWkEx30/HUyqpKa3bKyrDtBHVpEMdkhY1NdUrf7YI0BCNJOcQTcVkt/vlDemzM15EX X-Received: by 2002:a17:902:a9:: with SMTP id a38-v6mr25874650pla.102.1533144340379; Wed, 01 Aug 2018 10:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144340; cv=none; d=google.com; s=arc-20160816; b=c++wlwFWYTkqBcx/OYDyarzg/nBtgG21MWDdggTCZbjRurubvfe1pTeRu+MZm6W7J8 vM27i8Rf5FSH5KPVR/2kNmBdgshBNtjj2AgtimkpzOLZ36x9dFfiSilYv/za0ZYIOF0m kq8NvSyIcftBLsgHI6jOE3v1yJ6Grw9fiBGaA0QHnqnipT3dtRR+M/6eBupog15ZHVkJ vWnrhYAlUhi4lA8H3keB7g4sDWNTEj5B6EZTzjBHDakqpQbekvF3mQL573V/Z4es87gH s3SvrNnHv8eKsfEt7wCoeG3OGOEt5b9/42VUGKbaWVBU01RQGBwbcqrhX4MHmiHe6Lf1 LSwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=VL0Va0zhnbSENl44tazbJEKWi28fabx3pkSySHuuIJY=; b=HZJ2bKmHkbA0S9ST/s4kWQLAEWf3dSWj7YuNXZtGNNRij1WOu8ET9T97hTcPerZBYF 8Zt3VcEBl43nP6eUL40EiRtMYwV0EXJvj1f5RYoIGgdgSUWxo9Ll03Cp9MnQlDg5ASc0 A7/ecbxTt+RX2AR7peWyKpbg1BtYEIxMMhzlhr3XSD2RLkO+QGIOr/YleAC1NNpoRK6f 5uF7zdRhK7MsDTyzj/+EgboE9Gv0FGYBQF5PbvqHEBI+IgVE6GfN0lF1oQtAluZ7bsKE 4shKks40AGyYnE2B5ptSaqAITim4VeU21ioWk/lPAZHzDV6KtWjWF2IiJwwiNQ+rLFMR 5Qng== 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 e1-v6si17672414pfa.274.2018.08.01.10.25.25; Wed, 01 Aug 2018 10:25:40 -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 S2405536AbeHATKM (ORCPT + 99 others); Wed, 1 Aug 2018 15:10:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50946 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389790AbeHATKM (ORCPT ); Wed, 1 Aug 2018 15:10:12 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EEFACD40; Wed, 1 Aug 2018 17:23:29 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Stefan Wahren , Sasha Levin Subject: [PATCH 4.14 193/246] staging: vchiq_core: Fix missing semaphore release in error case Date: Wed, 1 Aug 2018 18:51:43 +0200 Message-Id: <20180801165020.958876027@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Wahren [ Upstream commit 8113b89fc615cfb531df0334fb3a091cf6a45ce0 ] The bail out branch in case of a invalid tx_pos missed a semaphore release. Dan Carpenter found this with a static checker. Fixes: d1eab9dec610 ("staging: vchiq_core: Bail out in case of invalid tx_pos") Reported-by: Dan Carpenter Signed-off-by: Stefan Wahren Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -601,6 +601,7 @@ reserve_space(VCHIQ_STATE_T *state, size } if (tx_pos == (state->slot_queue_available * VCHIQ_SLOT_SIZE)) { + up(&state->slot_available_event); pr_warn("%s: invalid tx_pos: %d\n", __func__, tx_pos); return NULL; }