aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/lpddr/lpddr2_nvm.c
diff options
context:
space:
mode:
authorAlexander Usyskin <[email protected]>2023-06-20 13:19:05 +0000
committerMiquel Raynal <[email protected]>2023-07-12 11:30:10 +0000
commit79c4a56250216991f1d965ee26dcd273376e4e91 (patch)
tree202bfcacd24d276d900ba9f14ee131682743f5d8 /drivers/mtd/lpddr/lpddr2_nvm.c
parentmtd: use refcount to prevent corruption (diff)
downloadkernel-79c4a56250216991f1d965ee26dcd273376e4e91.tar.gz
kernel-79c4a56250216991f1d965ee26dcd273376e4e91.zip
mtd: call external _get and _put in right order
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 <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
Diffstat (limited to 'drivers/mtd/lpddr/lpddr2_nvm.c')
0 files changed, 0 insertions, 0 deletions