Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933664Ab2KZRLg (ORCPT ); Mon, 26 Nov 2012 12:11:36 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:47897 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756588Ab2KZRLc (ORCPT ); Mon, 26 Nov 2012 12:11:32 -0500 From: Herton Ronaldo Krzesinski To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Piotr Haber , "John W. Linville" , Herton Ronaldo Krzesinski Subject: [PATCH 186/270] bcma: fix unregistration of cores Date: Mon, 26 Nov 2012 14:57:56 -0200 Message-Id: <1353949160-26803-187-git-send-email-herton.krzesinski@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1353949160-26803-1-git-send-email-herton.krzesinski@canonical.com> References: <1353949160-26803-1-git-send-email-herton.krzesinski@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1463 Lines: 45 3.5.7u1 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Piotr Haber commit 1fffa905adffbf0d3767fc978ef09afb830275eb upstream. When cores are unregistered, entries need to be removed from cores list in a safe manner. Reported-by: Stanislaw Gruszka Reviewed-by: Arend Van Spriel Signed-off-by: Piotr Haber Signed-off-by: John W. Linville Signed-off-by: Herton Ronaldo Krzesinski --- drivers/bcma/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 7e138ec..edb9233 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -131,9 +131,10 @@ static int bcma_register_cores(struct bcma_bus *bus) static void bcma_unregister_cores(struct bcma_bus *bus) { - struct bcma_device *core; + struct bcma_device *core, *tmp; - list_for_each_entry(core, &bus->cores, list) { + list_for_each_entry_safe(core, tmp, &bus->cores, list) { + list_del(&core->list); if (core->dev_registered) device_unregister(&core->dev); } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/