dummy = be32_to_cpup(p++);
dummy = be32_to_cpup(p++);
Assigning value to "dummy" here, but that stored value
is overwritten before it can be used.
delete invalid assignment statements in nfsd4_decode_exchange_id
Signed-off-by: n00202754 <[email protected]>
---
fs/nfsd/nfs4xdr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index a96843c..8e78541 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1392,8 +1392,8 @@ nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,
/* ssp_window and ssp_num_gss_handles */
READ_BUF(8);
- dummy = be32_to_cpup(p++);
- dummy = be32_to_cpup(p++);
+ be32_to_cpup(p++);
+ be32_to_cpup(p++);
break;
default:
goto xdr_error;
--
2.10.1
> On Jul 22, 2018, at 4:50 AM, nixiaoming <[email protected]> wrote:
>=20
> dummy =3D be32_to_cpup(p++);
> dummy =3D be32_to_cpup(p++);
> Assigning value to "dummy" here, but that stored value
> is overwritten before it can be used.
>=20
> delete invalid assignment statements in nfsd4_decode_exchange_id
>=20
> Signed-off-by: n00202754 <[email protected]>
> ---
> fs/nfsd/nfs4xdr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index a96843c..8e78541 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -1392,8 +1392,8 @@ nfsd4_decode_exchange_id(struct =
nfsd4_compoundargs *argp,
>=20
> /* ssp_window and ssp_num_gss_handles */
> READ_BUF(8);
> - dummy =3D be32_to_cpup(p++);
> - dummy =3D be32_to_cpup(p++);
> + be32_to_cpup(p++);
> + be32_to_cpup(p++);
If these values are not used, what's the point of byte swapping them?
Surely "p +=3D 2;" should be enough.
> break;
> default:
> goto xdr_error;
--
Chuck Lever
T24gU3VuLCAyMDE4LT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iANCj4gPiAJCS8q
IHNzcF93aW5kb3cgYW5kIHNzcF9udW1fZ3NzX2hhbmRsZXMgKi8NCj4gPiAJCVJFQURfQlVGKDgp
Ow0KPiA+IC0JCWR1bW15ID0gYmUzMl90b19jcHVwKHArKyk7DQo+ID4gLQkJZHVtbXkgPSBiZTMy
X3RvX2NwdXAocCsrKTsNCj4gPiArCQliZTMyX3RvX2NwdXAocCsrKTsNCj4gPiArCQliZTMyX3Rv
X2NwdXAocCsrKTsNCj4gDQo+IElmIHRoZXNlIHZhbHVlcyBhcmUgbm90IHVzZWQsIHdoYXQncyB0
aGUgcG9pbnQgb2YgYnl0ZSBzd2FwcGluZyB0aGVtPw0KPiBTdXJlbHkgInAgKz0gMjsiIHNob3Vs
ZCBiZSBlbm91Z2guDQo+IA0KPiANCj4gPiAJCWJyZWFrOw0KPiA+IAlkZWZhdWx0Og0KPiA+IAkJ
Z290byB4ZHJfZXJyb3I7DQo+IA0KDQpHaXZlbiB0aGF0IHRoZSB2YWx1ZSBvZiAncCcgaXNuJ3Qg
dXNlZCBlaXRoZXIsIHdoeSBub3QganVzdCBkZWxldGUNCnRob3NlIHR3byBsaW5lcyBhbHRvZ2V0
aGVyPw0KDQotLSANClRyb25kIE15a2xlYnVzdA0KTGludXggTkZTIGNsaWVudCBtYWludGFpbmVy
LCBIYW1tZXJzcGFjZQ0KdHJvbmQubXlrbGVidXN0QGhhbW1lcnNwYWNlLmNvbQ0KDQoNCg==
> On Jul 22, 2018, at 2:33 PM, Trond Myklebust <[email protected]> =
wrote:
>=20
> On Sun, 2018-07-22 at 14:12 -0400, Chuck Lever wrote:
>>> On Jul 22, 2018, at 4:50 AM, nixiaoming <[email protected]>
>>> wrote:
>>>=20
>>> dummy =3D be32_to_cpup(p++);
>>> dummy =3D be32_to_cpup(p++);
>>> Assigning value to "dummy" here, but that stored value
>>> is overwritten before it can be used.
>>>=20
>>> delete invalid assignment statements in nfsd4_decode_exchange_id
>>>=20
>>> Signed-off-by: n00202754 <[email protected]>
>>> ---
>>> fs/nfsd/nfs4xdr.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>=20
>>> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
>>> index a96843c..8e78541 100644
>>> --- a/fs/nfsd/nfs4xdr.c
>>> +++ b/fs/nfsd/nfs4xdr.c
>>> @@ -1392,8 +1392,8 @@ nfsd4_decode_exchange_id(struct
>>> nfsd4_compoundargs *argp,
>>>=20
>>> /* ssp_window and ssp_num_gss_handles */
>>> READ_BUF(8);
>>> - dummy =3D be32_to_cpup(p++);
>>> - dummy =3D be32_to_cpup(p++);
>>> + be32_to_cpup(p++);
>>> + be32_to_cpup(p++);
>>=20
>> If these values are not used, what's the point of byte swapping them?
>> Surely "p +=3D 2;" should be enough.
>>=20
>>=20
>>> break;
>>> default:
>>> goto xdr_error;
>>=20
>=20
> Given that the value of 'p' isn't used either, why not just delete
> those two lines altogether?
Sounds OK, READ_BUF is tracking progress through the buffer,
and it already updates "p" as a side-effect.
Might there be some nearby instances of open-coded "p" updates
that could also be removed, for similar reasons?
--
Chuck Lever
T24gU3VuLCAyMDE4LTA3LTIyIGF0IDE1OjAxIC0wNDAwLCBDaHVjayBMZXZlciB3cm90ZToNCj4g
PiBPbiBKdWwgMjIsIDIwMTgsIGF0IDI6MzMgUE0sIFRyb25kIE15a2xlYnVzdCA8DQo+ID4gdHJv
bmRteUBoYW1tZXJzcGFjZS5jb20+IHdyb3RlOg0KPiA+IA0KPiA+IE9uIFN1biwgMjAxOC0wNy0y
MiBhdCAxNDoxMiAtMDQwMCwgQ2h1Y2sgTGV2ZXIgd3JvdGU6DQo+ID4gPiA+IE9uIEp1bCAyMiwg
MjAxOCwgYXQgNDo1MCBBTSwgbml4aWFvbWluZyA8bml4aWFvbWluZ0BodWF3ZWkuY29tPg0KPiA+
ID4gPiB3cm90ZToNCj4gPiA+ID4gDQo+ID4gPiA+IGR1bW15ID0gYmUzMl90b19jcHVwKHAr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