um: vector: Remove unnecessary NULL check in destroy_queue()
PATCH 1/1 um: vector: Remove unnecessary NULL check in destroy_queue()
All callers of destroy_queue() already perform a NULL check, so a NULL qi will never be passed in. Inside destroy_queue(), we dereference qi immediately, and the subsequent NULL check on qi is unnecessary and confusing. Remove it to address the smatch warning.
Reported-by kernel test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Tiwei Bie <[email protected]>
--- arch/um/drivers/vector_kern.c | 2 -- 1 file changed, 2 deletions(-)
arch/um/drivers/vector_kern.c +0 -2
@@ -471,8 +471,6 @@ static void destroy_queue(struct vector_queue *qi)struct vector_private *vp =netdev_priv (qi->dev);struct mmsghdr *mmsg_vector; -if (qi ==NULL ) -return ;/* deallocate any skbuffs - we rely on any unused to be * set to NULL. */
Signature · 1 line
2.34.1
Quoted 19 lines · Tiwei Bie
All callers of
destroy_queue()already perform a NULL check, so a NULL qi will never be passed in. Insidedestroy_queue(), we dereference qi immediately, and the subsequent NULL check on qi is unnecessary and confusing. Remove it to address the smatch warning.Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Tiwei Bie <[email protected]>--- arch/um/drivers/vector_kern.c | 2 -- 1 file changed, 2 deletions(-)arch/um/drivers/vector_kern.c +0
-0
arch/um/drivers/vector_kern.c static void destroy_queue(struct vector_queue *qi) · line 476
Quoted 8 lines
arch/um/drivers/vector_kern.c +0
-2@@ -471,8 +471,6 @@ static void destroy_queue(struct vector_queue *qi)struct vector_private *vp =netdev_priv (qi->dev);struct mmsghdr *mmsg_vector; -if (qi ==NULL ) -return ;/* deallocate any skbuffs - we rely on any unused to be * set to NULL. */
Acked-by Anton Ivanov <[email protected]>
Signature · 2 lines
Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661