Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751655AbbHBFJ0 (ORCPT ); Sun, 2 Aug 2015 01:09:26 -0400 Received: from mail-qg0-f53.google.com ([209.85.192.53]:35666 "EHLO mail-qg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbbHBFJY (ORCPT ); Sun, 2 Aug 2015 01:09:24 -0400 MIME-Version: 1.0 In-Reply-To: References: <1438042590-17719-1-git-send-email-k.kozlowski@samsung.com> <20150729174619.GC23178@dtor-ws> <20150730001026.GH23178@dtor-ws> Date: Sun, 2 Aug 2015 14:09:23 +0900 X-Google-Sender-Auth: FgzQfIzI-t7HKKQBgDqFnXNRGfI Message-ID: Subject: Re: [PATCH] HID: hid-input: Fix accessing freed memory during driver unbind From: Krzysztof Kozlowski To: Jiri Kosina Cc: Dmitry Torokhov , Krzysztof Kozlowski , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, sre@kernel.org, linux-pm@vger.kernel.org, "H.J. Lu" , stable@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1086 Lines: 31 2015-08-01 21:11 GMT+09:00 Jiri Kosina : > On Wed, 29 Jul 2015, Dmitry Torokhov wrote: > >> > Another and less intrusive fix would be: >> > >> > char *name = dev->battery->desc->name; >> > struct power_supply_desc *psy_desc = dev->battery->desc; >> > power_supply_unregister(dev->battery); >> > kfree(name); >> > kfree(psy_desc); >> >> I would much rather prefer this to the other version as it does not >> leave memory hanging around, potentially indefinitely, but ultimately it >> is up to Jiri. > > I must have been in some broken state of mind when applying the original > one, thanks a lot for catching my brainfart, Dmitry! > > Kryzstof, could you please send me properly formatted patch with the > above, on top of your previous fix? Of course, I'll send next version. Best regards, Krzysztof -- 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/