From patchwork Mon Sep 26 22:36:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9351353 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 F3BDF6077B for ; Mon, 26 Sep 2016 22:36:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E393C28E86 for ; Mon, 26 Sep 2016 22:36:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D837728E8A; Mon, 26 Sep 2016 22:36:37 +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 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 40A7A28E86 for ; Mon, 26 Sep 2016 22:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751939AbcIZWgg (ORCPT ); Mon, 26 Sep 2016 18:36:36 -0400 Received: from mail-co1nam03on0056.outbound.protection.outlook.com ([104.47.40.56]:65212 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753240AbcIZWgf (ORCPT ); Mon, 26 Sep 2016 18:36:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VxPEUF24vSD2ddLLqEQ+QVA2SSU0b571//OAa+ZzknU=; b=QIJIhvkQ00DNpKfUXwlG4dXm++no4zCpNuvtWHAdGKjFsMiZQkPXcLK94vZ1dTlfgd3NEx7KOom1WbApuI5sOk63trMbhaPRq97UwAxyISD85hmsvzZ4C6lh8SYhiPQwhL9UHyK+tLczPxQ2cuShIGqHygTesexvLoTYizYHWEs= Received: from BY1PR0201CA0009.namprd02.prod.outlook.com (10.160.191.147) by CY1PR0201MB1516.namprd02.prod.outlook.com (10.163.139.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Mon, 26 Sep 2016 22:36:33 +0000 Received: from BY2FFO11FD050.protection.gbl (2a01:111:f400:7c0c::184) by BY1PR0201CA0009.outlook.office365.com (2a01:111:e400:4814::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5 via Frontend Transport; Mon, 26 Sep 2016 22:36:33 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BY2FFO11FD050.mail.protection.outlook.com (10.1.15.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.5 via Frontend Transport; Mon, 26 Sep 2016 22:36:32 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 86.E3.61581.5E0A9E75; Mon, 26 Sep 2016 15:27:52 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.301.0; Mon, 26 Sep 2016 15:36:28 -0700 X-AuditID: 0ac94371-5f3ff7000000f08d-df-57e9a0e47bf4 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 4C.22.02783.9E2A9E75; Mon, 26 Sep 2016 15:36:28 -0700 (PDT) To: Jens Axboe CC: Tejun Heo , "linux-block@vger.kernel.org" From: Bart Van Assche Subject: [PATCH] blkcg: Unlock blkcg_pol_mutex once if cpd == NULL Message-ID: Date: Mon, 26 Sep 2016 15:36:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOLMWRmVeSWpSXmKPExsXCddJ5ke6LBS/DDY7dlLX4v+cYm8XeW9oW v5YfZXRg9pjY/I7dY9OqTjaPz5vkApijuGxSUnMyy1KL9O0SuDK2rE8rmMJZ8ebtYrYGxgPs XYycHBICJhI31z9i62Lk4hASWMokMa11GStIQkhgB6NE+wkZmKKzH84xQxUxSjS3HGMBSYgI yEp83/0aqJuDg1kgRuLTM1uQMJuAkcS39zPBSoQFnCSWvdnHBmLzCthJrHt/GMxmEVCV+Hjg AjOILSoQIXHrYQcLRI2gxMmZT1ggRmpKrN+lDxJmFpCX2P52DtgJEgL/WCR+PnzIAnGnusTJ JfOZJjAKzkLSPguhfRaS9gWMzKsYxXIzc4pz01MLDE30ihPzUjKLs/WS83M3MUKCt3AH4+vb 3ocYBTgYlXh4LcpfhguxJpYVV+YeYpTgYFYS4fWZDxTiTUmsrEotyo8vKs1JLT7EKM3BoiTO ezH6Y5iQQHpiSWp2ampBahFMlomDU6qB0Xhbhh+nkvMm1fkrA07eDtK982eB1znXrNlxWyLN tC8wCnALqsgIbS8KDJ70NVrnqm/mxNk3NFsjzirqmixIzpr92cNG5JPOuf+LmF7wMCm/YDqw aYvmmx658kmxzxKTytR9ljBpMGpWKU/IPd96QfTvrnWTKk+fSFay9VxfeNtnFvdm7dgWJZbi jERDLeai4kQAEhYQdVoCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAJMWRmVeSWpSXmKPExsXCtZEjRffNopfhBheni1j833OMzWLvLW2L X8uPMjowe0xsfsfusWlVJ5vH501yAcxRXDYpqTmZZalF+nYJXBlb1qcVTOGsePN2MVsD4wH2 LkZODgkBE4mzH84xdzFycQgJLGaUePf+GytIQkRAVuL77tdsIDazQIxE+8abzCA2m4CRxLf3 M1lAbGEBJ4llb/aB1fAK2Emse38YzGYRUJX4eOACWL2oQITErYcdLBA1ghInZz5hgZipLvFn 3iVmCFteYvvbOcwTGHlmISmbhaRsFpKyBYzMqxjFcjNzinPTMwsMDfWKE/NSMouz9ZLzczcx gsOIM3IH49OJ5ocYmTg4pRoY78380O3o1WAS9ix5x5MKE+6IabXfHhlkb3NbouKxcO7kdDfh GFat1wYPJkTKXHFJmJuVwOt//2MD680kro9/RKLbXv7OesMZFyXfzyLebmv8kcdfilFxlkHE L17+/ypb/jT2sRyamO91isdedI/HEmfZX5+Z9VT3umfv7F3A4Cw1vZm5/Y0SS3FGoqEWc1Fx IgCpgG6t0wEAAA== X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(189998001)(2906002)(356003)(97736004)(305945005)(64126003)(7846002)(36756003)(4001350100001)(65806001)(65956001)(47776003)(83506001)(33646002)(87936001)(19580405001)(586003)(19580395003)(50466002)(69596002)(2270400002)(77096005)(8936002)(5660300001)(31686004)(6916009)(53416004)(23676002)(110136003)(626004)(86362001)(31696002)(230700001)(106466001)(8676002)(50986999)(68736007)(92566002)(11100500001)(81166006)(4326007)(54356999)(65826007)(81156014)(229853001)(357404004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1516; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD050; 1:6bEUQUWZNEsasfT5WAs4OM5uFIlccLWKzYCWwfXxxnRqA0e3EmeN6jFMcCifSs0mSn61pkWe3YLHixIf9XwF6kvuZJbsJ9hxBTalIH06MNEKoizMbplo2FaHmvk8yNCAoHHpwRjlvuMOu89j2kDUpAxZ+s4uJpyAxYCZWZiEwbne3WRh7ssJ4ZT0a+MX+gwe51WmplI4ae6XC0+vJSawIGY8ua7olz8f4O/s42Bdj9fHD+6y3/8wLPFT1GzOflMBkBT2pM3Jaiu3+zXEe47N8BUNZJjo4gjTG+1UNKRxSBlZPu8YBJtUAvHsXI4P+Y92OYpQV5ur/EM1qb1tHZ+9Myp+8+K94ty115ELnJaL2u+LNMmaxMktQN3ZhV3/+m66GuTrHD3tUTclsOeL7pY9S6IJZRhvojCRKJBCGHKWqCDoATbwfelgCj7sh1mQJ1Jrqq2ExqmPhD4qQhFtE9ol38/O7JcRp1B/DIG3JL9TcZHprXBTiUyQh0py+aigbR4EgE8J80vZ3jjp4aKX3h43+w== X-MS-Office365-Filtering-Correlation-Id: dd7d4660-4433-40eb-c804-08d3e65d90dc X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1516; 2:ue6Ew2hUZ4f7O2XTsWmAAIg1PVPZ7yzU2bkBxqtHrMQvUFe7lC3D5zTqRAjTRcnBGy1AoW0it1UEl26dWfZxusUQY6wWw8dE6Il42VhbbzO3vfPcratznMhZLOcZVt1d/UvmXp0pEnvMqmHEh9oAOAfSIzr2YqN2AUqDOdKc7OETgBhEy/ElNq8fVtls2adg; 3:FeE3LrlEPnqqOe3/K7DwGItDdRUbKrT37uO2fJwRW26oYpvmLAPmdbnlUw7NiYKLZod61Jf8S5+aMM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i4Ap9Hmg8VOcqBBZAfRid2o/qvkgqjIr3oXjFZrf/eTEB+0SCqXCDt629HPlrqwFourjLE2drrOqPZTgXjd12a1ajhS6ir/mdt4nn3UsITocgeDWypEF8cspRHue+R+mW24fE2wy1fApBmRImhVK5mOwCbMV3k9NZi/mbKv+CLUuCQB7QVTib+nz8IRxL54lRFH9rr+Q5zth5KSr7n2Ss9Ie5G9JE2ZzAnQe35GZW/Ha2SqZcOROxT0HBbr8V/ww/BktU0c0wDk/Om2JVqa7fl98OdYSYyhdb1L1d1rMRuQQG34YUy2bZVk2WOq3gRiddjEwRISw5EvAij8uGK09gYwRqHKYGCPCZBkxj7jEhBooWUS0CQSpHDywQrSgRu4bjSewPBUIS6qtREGjU1k8UTK/g1WH8Tw8SJoB9hw8UX6fgtC9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506)(9452136761055)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13018025)(13016025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY1PR0201MB1516; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1516; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1516; 4:O08/YbWv4O6kHa2wiiW1pRJm1WU1bd27jK/ZOiw2WnbNN18tu93OhC24LX5kRI2IfjTF50DJOWCnH8TWI8NNH7jY2GarLfComUhAtyyNbamthiNViEMQQY9oWbWqx1pHGfXr/+5t/cCqDg/BjzQsEBV+eF8+u9h8KW+kcoJZ8IfzKBptV1QutdEvZ+CPPwN6+i1RXIBcp8OvwhowwkXBhv89SePmeUF8u59SBjDq08pReFkD5mol+rirgpxACEtKb04p5oloH/mzJm0ycRoBn7qEkuNBl3v6THRIC2VIVIQlIxERpnYGb8QYRixAD5YAnvzlUebcpeDH3fc+YqyL7m6kn5UphFPjpARsj9r/edB8rKs0B+HSF3A4u56NF4UVdsKOechP5Ab6BB6JWYob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nY1J SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1516; 20:uwihmqYGd8orEyFi9PxVGgm5BcygHPiTSspkxfJJKkRrGhjDca6T5K2naK3uhSmEPiVXmeLcazEHSXIjrlPE3iFspt630OxazHdExuI6Wmcg7XW1StFWf00m/2XekObHPSs6pDg2o7um68GelUF8HWglDah3eJlLlBOCG+tYatmTZeAwzNXCWlg3Vw3kUyKR3TXZkVrjwf5ojshWFhXO8BhQD+bY0Jp8d+EyNpN3iJccPSInnKYoph7npiNAgk8w X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2016 22:36:32.5795 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1516 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unlocking a mutex twice is wrong. Hence modify blkcg_policy_register() such that blkcg_pol_mutex is unlocked once if cpd == NULL. This patch avoids that smatch reports the following error: block/blk-cgroup.c:1378: blkcg_policy_register() error: double unlock 'mutex:&blkcg_pol_mutex' Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: --- block/blk-cgroup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index dd38e5c..cdbca1c 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1327,8 +1327,10 @@ int blkcg_policy_register(struct blkcg_policy *pol) for (i = 0; i < BLKCG_MAX_POLS; i++) if (!blkcg_policy[i]) break; - if (i >= BLKCG_MAX_POLS) + if (i >= BLKCG_MAX_POLS) { + mutex_unlock(&blkcg_pol_mutex); goto err_unlock; + } /* register @pol */ pol->plid = i; @@ -1374,8 +1376,8 @@ err_free_cpds: } } blkcg_policy[pol->plid] = NULL; + err_unlock: - mutex_unlock(&blkcg_pol_mutex); mutex_unlock(&blkcg_pol_register_mutex); return ret; }