dm zoned: free dmz->ddev array in dmz_put_zoned_devices
stable inclusion from stable-v5.10.198 commit ccd87fe7a0f6f42bbe1c577125d432ebdcc59198 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I987V5 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ccd87fe7a0f6f42bbe1c577125d432ebdcc59198 -------------------------------- commit 9850ccd5 upstream. Commit 4dba1288 ("dm zoned: support arbitrary number of devices") made the pointers to additional zoned devices to be stored in a dynamically allocated dmz->ddev array. However, this array is not freed. Rename dmz_put_zoned_device to dmz_put_zoned_devices and fix it to free the dmz->ddev array when cleaning up zoned device information. Remove NULL assignment for all dmz->ddev elements and just free the dmz->ddev array instead. Found by Linux Verification Center (linuxtesting.org). Fixes: 4dba1288 ("dm zoned: support arbitrary number of devices") Cc: stable@vger.kernel.org Signed-off-by:Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by:
Mike Snitzer <snitzer@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment