From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934342AbbDJNuY (ORCPT ); Fri, 10 Apr 2015 09:50:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36807 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965008AbbDJNXF (ORCPT ); Fri, 10 Apr 2015 09:23:05 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ameya Palande <2ameya@gmail.com>, Lee Jones Subject: [PATCH 3.14 38/38] mfd: kempld-core: Fix callback return value check Date: Fri, 10 Apr 2015 15:19:26 +0200 Message-Id: <20150410131704.480385466@linuxfoundation.org> X-Mailer: git-send-email 2.3.5 In-Reply-To: <20150410131701.236830106@linuxfoundation.org> References: <20150410131701.236830106@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ameya Palande <2ameya@gmail.com> commit c8648508ebfc597058d2cd00b6c539110264a167 upstream. On success, callback function returns 0. So invert the if condition check so that we can break out of loop. Signed-off-by: Ameya Palande <2ameya@gmail.com> Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- drivers/mfd/kempld-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c @@ -629,7 +629,7 @@ static int __init kempld_init(void) if (force_device_id[0]) { for (id = kempld_dmi_table; id->matches[0].slot != DMI_NONE; id++) if (strstr(id->ident, force_device_id)) - if (id->callback && id->callback(id)) + if (id->callback && !id->callback(id)) break; if (id->matches[0].slot == DMI_NONE) return -ENODEV;