From patchwork Tue Sep 13 14:24:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9329237 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 9642A6077F for ; Tue, 13 Sep 2016 14:24:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8733329503 for ; Tue, 13 Sep 2016 14:24:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B4762950C; Tue, 13 Sep 2016 14:24:59 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 0AB9E29503 for ; Tue, 13 Sep 2016 14:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754877AbcIMOY6 (ORCPT ); Tue, 13 Sep 2016 10:24:58 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33784 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbcIMOY5 (ORCPT ); Tue, 13 Sep 2016 10:24:57 -0400 Received: by mail-pa0-f67.google.com with SMTP id h5so9291850pao.0 for ; Tue, 13 Sep 2016 07:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eeY7drNd6nHUY61j2vu5neL+LOi6xm1Yq6k03YbrNBA=; b=Cm+bANCV1So8wSQky1mvobKJ/30o22WeazCk0Wi4pyv4zROuszjwhQ1tdrDZrrfOuR 9FrCh7KR8RbYeXeL+EE5h6ACzyDwA+q9gRV05YOsuzZ29v3gOA/2j/ZsFQz/09rsYbrk fbdQD7GX+DYPfi5MnIGrvr2+1texEVG7CTgiEEEaLF+Z4vjj2LKPW6Dry7CpntLn8hdc h54BcI494w7FYpSm3Kivry7YEc1TlvPk2EHLV8inCOSPodjiffV0EJHWOHdxX2XHYd7e SdARyYB9Z0BhJLx4fkj86wTTAt+QaxSg3KvXs+b5iwGItT/VbsIyPth+ipAH9JB1LVDb 22rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eeY7drNd6nHUY61j2vu5neL+LOi6xm1Yq6k03YbrNBA=; b=kPaxTo37P8ta1Mgz+hUlSUo1Dd4N2ejZxlcQ84dNlKLdk8gTXZF83wsgJpgiwQSebd asuEUdWAVyLlACABAgssbyJWQGOGLUfS+uHzhaaPyZ23Q7bnShJ5AxMVMv9Hmk5/AuVz yEWv7EP6ddyeWx7f15feMgXrJvjWKelCfJcWhI/xh7X6vnG9QLnIKTAIkwL2tbWuL9vh na5ohaY3jdIze5Mvbws5aNDXwJ7y/z6AbR8SNVoEc8xhWdoT87fA9Titqz5hRCRI2XwR 2L3QZXWckMTz3SOCS9PZwaNuvHZGAJ5jIMPR9u6ThtblKajQbp+1fuDwViby20rKAtBM TtGA== X-Gm-Message-State: AE9vXwNV2wOtvRKQqf1GkuBAygKks2rNipaB8N5iG0PB/hh7fVzTyQRUtRw1j3jL4j/gUw== X-Received: by 10.66.157.103 with SMTP id wl7mr1860537pab.116.1473776696765; Tue, 13 Sep 2016 07:24:56 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id ve9sm31758201pac.12.2016.09.13.07.24.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Sep 2016 07:24:55 -0700 (PDT) From: Wei Yongjun To: Dmitry Torokhov , Mauro Carvalho Chehab , Hans Verkuil , Nick Dyer Cc: Wei Yongjun , linux-input@vger.kernel.org Subject: [PATCH -next] [media] Input: fix missing unlock on error in rmi_f54_request_report() Date: Tue, 13 Sep 2016 14:24:50 +0000 Message-Id: <1473776690-3748-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Add the missing unlock before return from function rmi_f54_request_report() in the error handling case. Signed-off-by: Wei Yongjun Acked-by: Nick Dyer --- drivers/input/rmi4/rmi_f54.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" 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/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c index bd86d3d..99a8836 100644 --- a/drivers/input/rmi4/rmi_f54.c +++ b/drivers/input/rmi4/rmi_f54.c @@ -198,8 +198,10 @@ static int rmi_f54_request_report(struct rmi_function *fn, u8 report_type) mutex_lock(&f54->data_mutex); error = rmi_write(rmi_dev, fn->fd.command_base_addr, F54_GET_REPORT); - if (error < 0) + if (error < 0) { + mutex_unlock(&f54->data_mutex); return error; + } init_completion(&f54->cmd_done);