Skip to contentSkip to conversation

Send durable handle v2 contexts when use of persistent handles required

DISCUSSION Dan Carpenter 2 participants 2 messages Nov 3, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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: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

Signature · 3 lines
Thanks,

Steve