[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230712141345.354928-1-miquel.raynal@bootlin.com>
Date: Wed, 12 Jul 2023 16:13:45 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Alexander Usyskin <alexander.usyskin@...el.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Tomas Winkler <tomas.winkler@...el.com>,
Vitaly Lubart <vitaly.lubart@...el.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH 2/2] mtd: call external _get and _put in right order
On Tue, 2023-06-20 at 13:19:05 UTC, Alexander Usyskin wrote:
> MTD provider provides mtd_info object to mtd subsystem.
> With kref patch the mtd_info object can be alive after
> provider released mtd device.
> Fix calling order in _get and _put functions to allow
> mtd provider to safely alloc and release mtd object.
>
> Execute:
> 1) call external _get
> 2) get_module
> 3) add internal kref
> in the get function and opposite order in the put one.
>
> The _put_device callback should be the last in put
> as the master struct memory may be freed in this callback.
>
> Signed-off-by: Alexander Usyskin <alexander.usyskin@...el.com>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
Powered by blists - more mailing lists