From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: Re: [RFC 0/4] clk/driver: platform: Fix kfree() of const memory on setting driver_override Date: Mon, 18 Feb 2019 11:40:12 +0100 Message-ID: References: <1550484960-2392-1-git-send-email-krzk@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Russell King , Mark Brown , Linux Kernel Mailing List , linux-spi , Greg Kroah-Hartman , "Rafael J. Wysocki" , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , Michael Turquette , Stephen Boyd , Kukjin Kim , Andy Gross , David Brown , Srinivas Kandagatla , linux-samsung-soc@vger.kernel.org, linux-clk , Linux ARM , linux-arm-msm@vger.ke To: Krzysztof Kozlowski Return-path: In-Reply-To: <1550484960-2392-1-git-send-email-krzk@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-spi.vger.kernel.org Hi Krzysztof, On Mon, Feb 18, 2019 at 11:27 AM Krzysztof Kozlowski wrote: > The problem > =========== > Several device types (platform, amba, spi etc.) provide a driver_override > field. On sysfs store or during device removal, they kfree() the > existing value. > > However the users are unaware of this and set the driver_override like: > > pdev->driver_override = "exynos5-subcmu"; > > which obviously leads to error. IMHO driver_override is not meant to be set by a driver, only from userspace, for binding the device to vfio (is there another use case?). > clk: samsung: exynos5: Fix kfree() of const memory on setting > driver_override > slimbus: ngd: Fix kfree() of const memory on setting driver_override I see all users set override immediately after allocating a platform device. Can't they just allocate a platform device using the override name instead? What am I missing? Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds