From patchwork Mon Jul 25 07:01:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9245279 X-Patchwork-Delegate: rui.zhang@intel.com 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 0AFBE60757 for ; Mon, 25 Jul 2016 07:01:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDC46212D9 for ; Mon, 25 Jul 2016 07:01:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD3B3262FF; Mon, 25 Jul 2016 07:01:31 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 79A22212D9 for ; Mon, 25 Jul 2016 07:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751154AbcGYHBa (ORCPT ); Mon, 25 Jul 2016 03:01:30 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:32835 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbcGYHBa (ORCPT ); Mon, 25 Jul 2016 03:01:30 -0400 Received: by mail-pa0-f66.google.com with SMTP id q2so10934635pap.0 for ; Mon, 25 Jul 2016 00:01:30 -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=PWZyNKoyHYXfkLrCl5gUoFpY0bSvycF+ZI8SIhi56ag=; b=w+14ZrvGC3qZA4wRoyEdCaV+IZz9ErKxoVSgE3T5qepslMCtQYE0rxCluKooOZi+S/ YjxspYsb8X4Q4j0naFtAw/dKMrr9jSoYTBo1dOtGZMUC17KaKg2yxEf0y5C/BLvGRTH7 Moyy5GWf2tANEY4U7T9Tedh8RIpVONB3CrSaM2Sq9Qjvk8wK2Y/VheHlRDBLA0q8FfOx HeSNbtSN4p4vCIdhjqDjN94M8uiADvXbyYauuMFe3RMTxIO+x2304kfE+sIOVriLH7MC Y9SRSvADcl1MRVylq+7PdXS1rmDHU2gPc5l/362k4Eb0Z9yhyO7WomfEA6GHV4347oHU FUQw== 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=PWZyNKoyHYXfkLrCl5gUoFpY0bSvycF+ZI8SIhi56ag=; b=LkZ37/Zq5lTIv/+AiKkX+YoWav12yyKM0Lb+sslo/BjpWtHHPIm1Z8+KiMHoGmot4z 5R0DFk5cmG1fS+OHe3s05N+6gU9xpIu0kkvEQrfa84pM8lB5iyxZgFEAMCwxIBeWSJa/ MtrFQw1yFDECgwChqFGl5U2Vj+CeIgxu7mEJua9NmCWL+h0d5iB654mGc1/bqKmql2Ra +iUbbmuGgl3EMABeF59q08MouArhsWehLRtVIbBdz8tNRJjYysY5Nkqkt3WFR/XByyUb b5i31ydU+ojRBb4or3Y/wyUMoh8TgMYBRaVGpELgPIQG6nO7uSmyKCanwFCZ4R80KE/Q oPhg== X-Gm-Message-State: AEkoouuqWclsPNWpfZMhI6FfS4GAlVs829TVldYrL8yXB/gT7v9LIoDgcMWmIM0MXr6jhg== X-Received: by 10.66.162.4 with SMTP id xw4mr26850869pab.97.1469430089519; Mon, 25 Jul 2016 00:01:29 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id ty6sm37185304pac.18.2016.07.25.00.01.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jul 2016 00:01:28 -0700 (PDT) From: Wei Yongjun To: Zhang Rui , Eduardo Valentin Cc: Wei Yongjun , linux-pm@vger.kernel.org Subject: [PATCH -next] thermal: clock_cooling: Fix missing mutex_init() Date: Mon, 25 Jul 2016 07:01:19 +0000 Message-Id: <1469430079-8533-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver allocates the mutex but not initialize it. Use mutex_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun --- drivers/thermal/clock_cooling.c | 1 + 1 file changed, 1 insertion(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" 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/thermal/clock_cooling.c b/drivers/thermal/clock_cooling.c index 1b4ff0f..ed5dd0e 100644 --- a/drivers/thermal/clock_cooling.c +++ b/drivers/thermal/clock_cooling.c @@ -426,6 +426,7 @@ clock_cooling_register(struct device *dev, const char *clock_name) if (!ccdev) return ERR_PTR(-ENOMEM); + mutex_init(&ccdev->lock); ccdev->dev = dev; ccdev->clk = devm_clk_get(dev, clock_name); if (IS_ERR(ccdev->clk))