Re: [PATCH 4/4] alpha: Move two assignments for the variable "res" in srm_env_proc_write()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> A local variable was set to an error code in two cases before a concrete
>> error situation was detected. Thus move the corresponding assignment into
>> an if branch to indicate a software failure there.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> Acked-by: Jan-Benedict Glaw <jbglaw@xxxxxxxxxx>

Thanks for your positive feedback.


Unfortunately, I have got the impression that this update step is inappropriate
so far because the suggested change for the handling of the error code “-EFAULT”
can be incomplete (or a bit too much).

Which implementation would you prefer?

A) Keep the variable assignment before the check for the call of
   the function “copy_from_user”

B) Add an assignment in another condition branch at the end.

 		res = (int) ret1;
+	} else {
+		res = -EFAULT;
 	}

Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux