Send durable handle v2 contexts when use of persistent handles required
Subsystems (2)
Hello Steve French,
The patch ea81d9ba9d72: "Send durable handle v2 contexts when use of persistent handles required" from Oct 3, 2015, leads to the following static checker warning:
fs/cifs/smb2pdu.c:1156 create_durable_v2_buf() warn: struct type mismatch 'create_durable_v2 vs create_durable'
fs/cifs/smb2pdu.c
1151 static struct create_durable_v2 *
1152 create_durable_v2_buf(struct cifs_fid *pfid)
1153 { 1154 struct create_durable_v2 *buf;
1155
1156 buf = kzalloc(sizeof(struct create_durable), GFP_KERNEL);
I think this is a problem, isn't create_durable_v2 larger? Smatch is bad at calculating the sizes of enums.
1157 if (!buf)
1158 return NULL;
1159
regards,
dan carpenter
Good catch. Updating patch.
Quoted 26 lines · Dan Carpenter
Hello Steve French,
The patch
ea81d9ba9d72: "Send durable handle v2 contexts when use of persistent handles required" from Oct 3, 2015, leads to the following static checker warning:
fs/cifs/smb2pdu.c:1156create_durable_v2_buf()
warn: struct type mismatch 'create_durable_v2vscreate_durable'
fs/cifs/smb2pdu.c1151 static struct create_durable_v2 * 1152 create_durable_v2_buf(struct cifs_fid *pfid) 1153 {1154 struct
create_durable_v2*buf;
1155
1156 buf =kzalloc(sizeof(struct create_durable), GFP_KERNEL);I think this is a problem, isn't
create_durable_v2larger? Smatch is bad at calculating the sizes of enums.1157 if (!buf)
1158 return NULL;
1159regards,
dan carpenter
Signature · 3 lines
Thanks, Steve