Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424265AbcKPWzH (ORCPT ); Wed, 16 Nov 2016 17:55:07 -0500 Received: from balrog.mythic-beasts.com ([93.93.130.6]:52704 "EHLO balrog.mythic-beasts.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423053AbcKPWzB (ORCPT ); Wed, 16 Nov 2016 17:55:01 -0500 From: Luis Henriques To: Gregory CLEMENT , Arnd Bergmann , Ben Dooks , Evan Wang , Marcin Wojtas Cc: linux-kernel@vger.kernel.org, Luis Henriques Subject: [PATCH] bus: mvebu-mbus: fix iounmap() in error path Date: Wed, 16 Nov 2016 22:54:45 +0000 Message-Id: <20161116225445.30771-1-henrix@camandro.org> X-BlackCat-Spam-Score: -28 X-Mythic-Debug: Threshold = On = Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 944 Lines: 28 This patch fixes the following Coccinelle error: ./drivers/bus/mvebu-mbus.c:1115:2-8: \ ERROR: missing iounmap; ioremap on line 1108 \ and execution via conditional on line 1113 Although all mvebu_mbus_common_init() callers seem to actually use &mbus_state in the 1st argument, this is still a bug that could be triggered by future changes. Signed-off-by: Luis Henriques --- drivers/bus/mvebu-mbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index c7f396903184..449466eff56f 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c @@ -1111,7 +1111,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, mbus->sdramwins_base = ioremap(sdramwins_phys_base, sdramwins_size); if (!mbus->sdramwins_base) { - iounmap(mbus_state.mbuswins_base); + iounmap(mbus->mbuswins_base); return -ENOMEM; }