Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753684AbYHLUT7 (ORCPT ); Tue, 12 Aug 2008 16:19:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751378AbYHLUTv (ORCPT ); Tue, 12 Aug 2008 16:19:51 -0400 Received: from xes-mad.com ([216.165.139.214]:37632 "EHLO xes-mad.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305AbYHLUTv (ORCPT ); Tue, 12 Aug 2008 16:19:51 -0400 Subject: Re: [PATCHv3] leds-pca955x: Add proper error handling and fix bogus memory handling From: Nate Case To: Sven Wegener Cc: rpurdie@rpsys.net, Andrew Morton , linux-kernel In-Reply-To: References: <1210972198.13845.540.camel@localhost.localdomain> Content-Type: text/plain Date: Tue, 12 Aug 2008 15:18:18 -0500 Message-Id: <1218572298.20206.35.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 963 Lines: 26 On Fri, 2008-08-08 at 09:27 +0200, Sven Wegener wrote: > Check the return value of led_classdev_register and unregister all > registered > devices, if registering one device fails. Also the dynamic memory > handling is > totally bogus. You can't allocate multiple chunks via kzalloc() and > expect them > to be in order later. > > Signed-off-by: Sven Wegener Acked-by: Nate Case Thanks for the fix. It looks correct and I tested it on my board with a pca9553. I also confirmed that the original driver would in fact kernel Oops if compiled as a module and you rmmod it. With this fix, I can repeatedly insmod/rmmod successfully. -- Nate Case -- 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/