[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <oshrhoyltm2unauarzluds3dczla6zf3dhaqk7w5ua337sbllo@wbqyquk32mhh>
Date: Wed, 26 Nov 2025 22:53:36 +0530
From: Abdun Nihaal <abdun.nihaal@...il.com>
To: Navaneeth K <knavaneeth786@...il.com>
Cc: parthiban.veerasooran@...rochip.com, christian.gromm@...rochip.com,
gregkh@...uxfoundation.org, linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] most: core: fix resource leak in
most_register_interface error paths
On Tue, Nov 25, 2025 at 10:56:05PM +0000, Navaneeth K wrote:
> The function most_register_interface() did not correctly release resources
> if it failed early (before device_register). In these cases, it returned
> an error code immediately, leaking the memory allocated for the interface.
>
> Fix this by initializing the device early via device_initialize() and
> calling put_device() on all error paths. This ensures the release
> callback is triggered to free memory.
>
> Switch to using device_add() instead of device_register() to handle
> the split initialization.
Acked-by: Abdun Nihaal <abdun.nihaal@...il.com>
Powered by blists - more mailing lists