]> granicus.if.org Git - zfs/commitdiff
Fix coverity defects: CID 147474
authorTobin Harding <me@tobin.cc>
Tue, 10 Oct 2017 23:41:47 +0000 (10:41 +1100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 10 Oct 2017 23:41:47 +0000 (16:41 -0700)
CID 147474: Logically dead code (DEADCODE)

Remove ternary operator and return `error` directly.

Currently return value is derived from a ternary operator. The
conditional is always true. The ternary operator is therefore
redundant i.e dead code.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Closes #6723

module/zfs/sa.c

index 8046dbde28adc24f869235bea798a8840bc220df..f0a18bad8dc4f791c03d68858a026640bc46407d 100644 (file)
@@ -980,7 +980,8 @@ bail:
        kmem_free(sa->sa_user_table, count * sizeof (sa_attr_type_t));
        sa->sa_user_table = NULL;
        sa_free_attr_table(sa);
-       return ((error != 0) ? error : EINVAL);
+       ASSERT(error != 0);
+       return (error);
 }
 
 int