From patchwork Fri Jan 19 13:22:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10175285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 63DFB60386 for ; Fri, 19 Jan 2018 13:22:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5415C28695 for ; Fri, 19 Jan 2018 13:22:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48AF62869F; Fri, 19 Jan 2018 13:22:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1542628695 for ; Fri, 19 Jan 2018 13:22:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755008AbeASNWt (ORCPT ); Fri, 19 Jan 2018 08:22:49 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:40542 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754892AbeASNWs (ORCPT ); Fri, 19 Jan 2018 08:22:48 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0JDMTrB140018; Fri, 19 Jan 2018 13:22:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=5cNzDGmRJ9dg9pozemYxTjQ8jWQPfwfVPSs3r6qPTVM=; b=srDXmUiZmWzZHv2d3dhgtZdTihbfflwiPM7zvBqoBAvZ8mQ4r3uqsA189POHAuzBOYop 9NsbMkgIfyxiPbUmPFeXYccbVPK+4ILjvVCWwYVr427MCO2+lAsysdBZ7U/b6hPAUnxR 2V02L/qJQhNgOpqeVzU4riqIRq1dp66yWBIdZ6cxXHYqB4S6iEWxFWLOqmBgD2jICTLt F/ryDWrLuUN1RHHRsnVT9EuRMFEcuDzotSne9zLTIQhhkRcCsI2M4SLD/cySyRFQ+v6N cv5MsJv/AvpGIHljexAxEMqWkAZh+EJTKRWAwZsIcvCoAaSmPFPoPyv8Y2NRzVTT9zpa Yw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2fkga10a43-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Jan 2018 13:22:46 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0JDMkMt011885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Jan 2018 13:22:46 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0JDMjto010068; Fri, 19 Jan 2018 13:22:45 GMT Received: from mwanda (/41.202.241.56) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 19 Jan 2018 05:22:44 -0800 Date: Fri, 19 Jan 2018 16:22:36 +0300 From: Dan Carpenter To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] rpmsg: smd: Fix double unlock in __qcom_smd_send() Message-ID: <20180119132236.GA32641@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.2 (2017-12-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8778 signatures=668654 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801190175 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We're not holding the lock here, so we shouldn't unlock. Fixes: 178f3f75bb4e ("rpmsg: smd: Don't hold the tx lock during wait") Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c index cea9a0930c4d..dd3e7eea8c38 100644 --- a/drivers/rpmsg/qcom_smd.c +++ b/drivers/rpmsg/qcom_smd.c @@ -759,11 +759,11 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data, qcom_smd_get_tx_avail(channel) >= tlen || channel->state != SMD_CHANNEL_OPENED); if (ret) - goto out; + goto ret; ret = mutex_lock_interruptible(&channel->tx_lock); if (ret) - goto out; + return ret; SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 1); }