]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: vme: vme_user: Remove NULL check of list_entry()
authorYuesong Li <liyuesong@vivo.com>
Thu, 22 Aug 2024 02:57:36 +0000 (10:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Aug 2024 07:48:05 +0000 (15:48 +0800)
list_entry() will never return a NULL pointer, thus remove the
check.

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
Link: https://lore.kernel.org/r/20240822025736.1208339-1-liyuesong@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vme_user/vme.c

index 218b19db6dac67dceca91a152c31fec31e28f2ef..42304c9f83a2dcf111a3596757a2717c562a8283 100644 (file)
@@ -416,10 +416,6 @@ void vme_slave_free(struct vme_resource *resource)
 
        slave_image = list_entry(resource->entry, struct vme_slave_resource,
                                 list);
-       if (!slave_image) {
-               dev_err(bridge->parent, "Can't find slave resource\n");
-               return;
-       }
 
        /* Unlock image */
        mutex_lock(&slave_image->mtx);
@@ -794,10 +790,6 @@ void vme_master_free(struct vme_resource *resource)
 
        master_image = list_entry(resource->entry, struct vme_master_resource,
                                  list);
-       if (!master_image) {
-               dev_err(bridge->parent, "Can't find master resource\n");
-               return;
-       }
 
        /* Unlock image */
        spin_lock(&master_image->lock);