usb: mtu3: Checking initialisation of the variable “mep” in two functions

Chunfeng Yun at
Sun Jun 28 21:48:13 EDT 2020

On Sat, 2020-06-27 at 14:28 +0200, Markus Elfring wrote:
> Hello,
> A source code analysis approach by the means of the semantic patch language
> (Coccinelle software) pointed an implementation detail out for further
> development considerations.
> The functions “mtu3_gadget_ep_set_halt” and “mtu3_gadget_ep_set_wedge” check
> at the beginning if the input parameter “ep” is a null pointer.
> The error code “-EINVAL” will be returned then.
> Can it be nicer to assign the variable “mep” only after a successful check
> instead of an initialisation before?
Yes, I'll fix it, thanks a lot

> Regards,
> Markus

More information about the linux-arm-kernel mailing list