fsi: core: Check error number after calling ida_simple_get
stable inclusion from stable-v5.10.150 commit 382a5fc49e6eee5b05b4e91744b7a5fd9f9bcbbb category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0XA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=382a5fc49e6eee5b05b4e91744b7a5fd9f9bcbbb -------------------------------- [ Upstream commit 35af9fb4 ] If allocation fails, the ida_simple_get() will return error number. So master->idx could be error number and be used in dev_set_name(). Therefore, it should be better to check it and return error if fails, like the ida_simple_get() in __fsi_get_new_minor(). Fixes: 09aecfab ("drivers/fsi: Add fsi master definition") Signed-off-by:Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by:
Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20220111073411.614138-1-jiasheng@iscas.ac.cn Signed-off-by:
Joel Stanley <joel@jms.id.au> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Jialin Zhang <zhangjialin11@huawei.com>
Loading
Please sign in to comment