Skip to content

Commit

Permalink
fs: cifs: remove unused variable.
Browse files Browse the repository at this point in the history
In SMB2_set_compression(), the "res_key" variable is only initialized to NULL
and later kfreed. It is therefore useless and should be removed.

Found with the following semantic patch:

<smpl>
@@
identifier foo;
identifier f;
type T;
@@
* f(...) {
...
* T *foo = NULL;
... when forall
    when != foo
* kfree(foo);
...
}
</smpl>

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Cyril Roelandt authored and Steve French committed Apr 16, 2014
1 parent 60977fc commit 8e3ecc8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/cifs/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,6 @@ SMB2_set_compression(const unsigned int xid, struct cifs_tcon *tcon,
u64 persistent_fid, u64 volatile_fid)
{
int rc;
char *res_key = NULL;
struct compress_ioctl fsctl_input;
char *ret_data = NULL;

Expand All @@ -1365,7 +1364,6 @@ SMB2_set_compression(const unsigned int xid, struct cifs_tcon *tcon,
2 /* in data len */, &ret_data /* out data */, NULL);

cifs_dbg(FYI, "set compression rc %d\n", rc);
kfree(res_key);

return rc;
}
Expand Down

0 comments on commit 8e3ecc8

Please sign in to comment.