staging: lustre: silence a static checker warning
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 16 Oct 2014 07:56:25 +0000 (10:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 08:25:23 +0000 (16:25 +0800)
Static checkers warn that if  cfs_cpt_table_print() returns an error
other than -EFBIG, then it would lead to a double free.  This is true
but cfs_cpt_table_print() only returns -EFBIG on error so it also won't
happen in real life.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c

index bbe2c68c18a60446dc37259fb224a9aedb49e2ff..83d3f08a37b26462e31535023f7df0526c7007d8 100644 (file)
@@ -365,8 +365,8 @@ static int __proc_cpt_table(void *data, int write,
                if (rc >= 0)
                        break;
 
-               LIBCFS_FREE(buf, len);
                if (rc == -EFBIG) {
+                       LIBCFS_FREE(buf, len);
                        len <<= 1;
                        continue;
                }