cifs: Use kzfree() to free password
PATCH 1/1 cifs: Use kzfree() to free password
We should zero out the password before we free it.
Fixes 3d6cacbb5310 ("cifs: Add DFS cache routines")
Signed-off-by Dan Carpenter <[email protected]>
--- fs/cifs/dfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/dfs_cache.c +1 -1
@@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new) err_free_unc:kfree (new->UNC); err_free_password: -kfree (new->password); +kzfree (new->password); err_free_username:kfree (new->username);kfree (new);
Signature · 1 line
2.17.1
Quoted 23 lines · Dan Carpenter
We should zero out the password before we free it.
Fixes 3d6cacbb5310 ("cifs: Add DFS cache routines")Signed-off-by Dan Carpenter <[email protected]>--- fs/cifs/dfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/cifs/dfs_cache.c +1
-1@@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new) err_free_unc:kfree (new->UNC); err_free_password: -kfree (new->password); +kzfree (new->password); err_free_username:kfree (new->username);kfree (new);Signature · 1 line
2.17.1
Reviewed-by Paulo Alcantara <[email protected]>
Thanks!
Paulo
Good catch
Quoted 26 lines · Dan Carpenter via samba-technical
We should zero out the password before we free it.
Fixes 3d6cacbb5310 ("cifs: Add DFS cache routines")Signed-off-by Dan Carpenter <[email protected]>--- fs/cifs/dfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/cifs/dfs_cache.c +1
-2@@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new) err_free_unc:kfree (new->UNC); err_free_password: -kfree (new->password); +kzfree (new->password); err_free_username:kfree (new->username);kfree (new); --2.17.1
Signature · 3 lines
Thanks, Steve
Steve French
Appliedmerged into cifs-2.6.git for-next
Quoted 31 lines · Paulo Alcantara
Quoted 22 lines · Dan Carpenter
We should zero out the password before we free it.
Fixes 3d6cacbb5310 ("cifs: Add DFS cache routines")Signed-off-by Dan Carpenter <[email protected]>--- fs/cifs/dfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/cifs/dfs_cache.c +1
-2@@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new) err_free_unc:kfree (new->UNC); err_free_password: -kfree (new->password); +kzfree (new->password); err_free_username:kfree (new->username);kfree (new); --Quoted 1 line
2.17.1
Reviewed-by Paulo Alcantara <[email protected]>Thanks!
Paulo
Signature · 3 lines
Thanks, Steve