Skip to contentSkip to conversation

NFS: Add a client-side function to display NFS file handles

DISCUSSION Dan Carpenter 3 participants 3 messages Mar 6, 2012

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

Hello Chuck Lever,

This is a semi-automatic email about new static checker warnings.

The patch 20d27e929fb4: "NFS: Add a client-side function to display NFS file handles" from Mar 1, 2012, leads to the following Smatch complaint:

fs/nfs/inode.c:1061 _nfs_display_fhandle()
warn: variable dereferenced before check 'fh' (see line 1061)

fs/nfs/inode.c
1060

  1061		if (fh->size == 0 || fh == NULL) {
                    ^^^^^^^^         ^^^^^^^^^^
                   dereference          check
  1062			printk(KERN_DEFAULT "%s at %p is empty\n", caption, fh);
  1063			return;

regards,
dan carpenter

#1 lore raw

Trond-

Can you please reverse these checks in your version of the commit?

Begin forwarded message:

Quoted 33 lines

From: Dan Carpenter <[email protected]>
Subject: re: NFS: Add a client-side function to display NFS file handles
Date: March 6, 2012 5:51:35 AM EST
To: [email protected]
Cc: [email protected]

Hello Chuck Lever,

This is a semi-automatic email about new static checker warnings.

The patch 20d27e929fb4: "NFS: Add a client-side function to display NFS file handles" from Mar 1, 2012, leads to the following Smatch complaint:

fs/nfs/inode.c:1061 _nfs_display_fhandle()
warn: variable dereferenced before check 'fh' (see line 1061)

fs/nfs/inode.c
1060

 1061		if (fh->size == 0 || fh == NULL) {
                   ^^^^^^^^         ^^^^^^^^^^
                  dereference          check

1062 printk(KERN_DEFAULT "%s at %p is empty\n", caption, fh);
1063 return;

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#2 lore raw

T24gVHVlLCAyMDEyLTAzLTA2IGF0IDExOjE0IC0wNTAwLCBDaHVjayBMZXZlciB3cm90ZToNCj4g VHJvbmQtDQo+IA0KPiBDYW4geW91IHBsZWFzZSByZXZlcnNlIHRoZXNlIGNoZWNrcyBpbiB5b3Vy IHZlcnNpb24gb2YgdGhlIGNvbW1pdD8NCg0KVGhhdCBjb21taXQgaGFzIGFscmVhZHkgZ29uZSBp bnRvIG5mcy1mb3ItbmV4dCwgd2hpY2ggaXMgY29uc2lkZXJlZA0Kc3RhYmxlLCBzbyBJIGhhdmUg Y3JlYXRlZCBhIHNlcGFyYXRlIG9uZS1saW5lIGNvbW1pdCB0byBmaXggaXQuIEl0IGhhcw0KYmVl biBhcHBsaWVkIGluIHRoZSAnZGV2ZWwnIGJyYW5jaCwgd2hpY2ggd2lsbCBzb29uIGJlIG1lcmdl ZCBpbnRvDQpuZnMtZm9yLW5leHQuDQoNCg0KLS0gDQpUcm9uZCBNeWtsZWJ1c3QNCkxpbnV4IE5G UyBjbGllbnQgbWFpbnRhaW5lcg0KDQpOZXRBcHANClRyb25kLk15a2xlYnVzdEBuZXRhcHAuY29t DQp3d3cubmV0YXBwLmNvbQ0KDQo=