Skip to content

Commit 75d3bce

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: [CIFS] Fix reversed memset arguments Adds username in the upcall key for unattended mounts with keytab [CIFS] Remove redundant NULL check
2 parents a0abb93 + 0a891ad commit 75d3bce

3 files changed

Lines changed: 11 additions & 14 deletions

File tree

‎fs/cifs/cifs_spnego.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
119119
dp = description + strlen(description);
120120
sprintf(dp, ";uid=0x%x", sesInfo->linux_uid);
121121

122+
dp = description + strlen(description);
123+
sprintf(dp, ";user=%s", sesInfo->userName);
124+
122125
cFYI(1, ("key description = %s", description));
123126
spnego_key = request_key(&cifs_spnego_key_type, description, "");
124127

‎fs/cifs/cifssmb.c‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,8 +2159,7 @@ CIFSSMBCopy(const int xid, struct cifsTconInfo *tcon, const char *fromName,
21592159
cFYI(1, ("Send error in copy = %d with %d files copied",
21602160
rc, le16_to_cpu(pSMBr->CopyCount)));
21612161
}
2162-
if (pSMB)
2163-
cifs_buf_release(pSMB);
2162+
cifs_buf_release(pSMB);
21642163

21652164
if (rc == -EAGAIN)
21662165
goto copyRetry;
@@ -2249,8 +2248,7 @@ CIFSUnixCreateSymLink(const int xid, struct cifsTconInfo *tcon,
22492248
if (rc)
22502249
cFYI(1, ("Send error in SetPathInfo create symlink = %d", rc));
22512250

2252-
if (pSMB)
2253-
cifs_buf_release(pSMB);
2251+
cifs_buf_release(pSMB);
22542252

22552253
if (rc == -EAGAIN)
22562254
goto createSymLinkRetry;
@@ -4095,8 +4093,7 @@ CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses,
40954093
target_nodes, nls_codepage);
40964094

40974095
GetDFSRefExit:
4098-
if (pSMB)
4099-
cifs_buf_release(pSMB);
4096+
cifs_buf_release(pSMB);
41004097

41014098
if (rc == -EAGAIN)
41024099
goto getDFSRetry;
@@ -5117,8 +5114,7 @@ CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *tcon,
51175114
if (rc)
51185115
cFYI(1, ("SetPathInfo (perms) returned %d", rc));
51195116

5120-
if (pSMB)
5121-
cifs_buf_release(pSMB);
5117+
cifs_buf_release(pSMB);
51225118
if (rc == -EAGAIN)
51235119
goto setPermsRetry;
51245120
return rc;
@@ -5340,8 +5336,7 @@ CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
53405336
}
53415337
}
53425338
}
5343-
if (pSMB)
5344-
cifs_buf_release(pSMB);
5339+
cifs_buf_release(pSMB);
53455340
if (rc == -EAGAIN)
53465341
goto QAllEAsRetry;
53475342

@@ -5490,8 +5485,7 @@ ssize_t CIFSSMBQueryEA(const int xid, struct cifsTconInfo *tcon,
54905485
}
54915486
}
54925487
}
5493-
if (pSMB)
5494-
cifs_buf_release(pSMB);
5488+
cifs_buf_release(pSMB);
54955489
if (rc == -EAGAIN)
54965490
goto QEARetry;
54975491

‎fs/cifs/inode.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static void fill_fake_finddataunix(FILE_UNIX_BASIC_INFO *pfnd_dat,
172172
{
173173
struct inode *pinode = NULL;
174174

175-
memset(pfnd_dat, sizeof(FILE_UNIX_BASIC_INFO), 0);
175+
memset(pfnd_dat, 0, sizeof(FILE_UNIX_BASIC_INFO));
176176

177177
/* __le64 pfnd_dat->EndOfFile = cpu_to_le64(0);
178178
__le64 pfnd_dat->NumOfBytes = cpu_to_le64(0);
@@ -384,7 +384,7 @@ static int get_sfu_mode(struct inode *inode,
384384
static void fill_fake_finddata(FILE_ALL_INFO *pfnd_dat,
385385
struct super_block *sb)
386386
{
387-
memset(pfnd_dat, sizeof(FILE_ALL_INFO), 0);
387+
memset(pfnd_dat, 0, sizeof(FILE_ALL_INFO));
388388

389389
/* __le64 pfnd_dat->AllocationSize = cpu_to_le64(0);
390390
__le64 pfnd_dat->EndOfFile = cpu_to_le64(0);

0 commit comments

Comments
 (0)