RE: more serious sparse-detected bug (with fix)

From: David Mosberger <>
Date: 2004-10-05 17:20:02
>>>>> On Mon, 4 Oct 2004 21:30:20 -0700, "Luck, Tony" <> said:

  >> for (i = 4; i < 8; i++) {
  >> -		retval |= unw_access_gr(&info, i, &ppr->gr[i], &nat, 0);
  >> +		unsigned long val;
  >> +
  >> +		if (unw_access_gr(&info, i, &val, &nat, 0) < 0)
  >> +			return -EIO;
  >> +		retval |= __put_user(val, &ppr->gr[i]);
  >> }

  Tony> Couldn't see why you added another local 'val' here as well as
  Tony> the one declared at the top of the function ... so I dropped this
  Tony> one.  Otherwise it *looks* good.  I've put it in my tree
  Tony> (linux-ia64-release-2.6.9) which I'll push in a few minutes.

I added the declaration in the outer scope later on and then forgot to
delete the inner declaration.  Thanks for spotting that.

  >> trivially.  Patch below should fix the problem, but it's completely
  >> untested (I don't have any testcases for getregs/putregs).

  Tony> I'd be happy to hear from anyone who does have some sort of test
  Tony> exercising this before I ask Linus to pull.  The current crop of
  Tony> bugs have shown how easy it is for the eyes to skip over typos
  Tony> in this code.

Check with the IA32EL folks.  AFAIR, that was the primary reason for
the getregs/putregs addition.

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Tue Oct 5 03:20:28 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:31 EST