bdev/vbdev_lvol: Fix scanbuild error about Null poniter parameter.
Issue reorts: vbdev_lvol_ut.c:97:7: warning: Null pointer passed as an argument to a 'nonnull' parameter if (strncmp(alias, tmp->alias, SPDK_LVOL_NAME_MAX) == 0) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I0cc95c735ea7486263842f91a5866710f9ff61a5 Signed-off-by: yidong0635 <dongx.yi@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462598 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
425b89a4ed
commit
2ab927030d
@ -89,10 +89,10 @@ spdk_bdev_alias_del(struct spdk_bdev *bdev, const char *alias)
|
||||
{
|
||||
struct spdk_bdev_alias *tmp;
|
||||
|
||||
CU_ASSERT(alias != NULL);
|
||||
CU_ASSERT(bdev != NULL);
|
||||
|
||||
TAILQ_FOREACH(tmp, &bdev->aliases, tailq) {
|
||||
SPDK_CU_ASSERT_FATAL(alias != NULL);
|
||||
if (strncmp(alias, tmp->alias, SPDK_LVOL_NAME_MAX) == 0) {
|
||||
TAILQ_REMOVE(&bdev->aliases, tmp, tailq);
|
||||
free(tmp->alias);
|
||||
|
Loading…
Reference in New Issue
Block a user