Re: [PATCH v2 2/2] usb: roles: get usb role switch from parent only for usb-b-connector

From: Xu Yang

Date: Mon Mar 09 2026 - 22:55:47 EST


Hi Frank,

On Mon, Mar 09, 2026 at 03:48:59PM -0400, Frank Li wrote:
> From: Frank Li (AI-BOT) <frank.li@xxxxxxx>
>
> > if (!fwnode_device_is_compatible(fwnode, "usb-b-connector"))
> > return NULL;
>
> AI: Nit: inconsistent indentation. Should use a single tab, not two spaces.
> Use '\t' for the return statement to match kernel style.
>
> > parent = fwnode_get_parent(fwnode);
> >
> > if (!fwnode_property_present(parent, "usb-role-switch")) {
>
> AI: Missing NULL check on parent before passing to fwnode_property_present().
> If fwnode_get_parent() returns NULL, the next call will dereference it.
> Add: if (!parent) return NULL;

Ignore this!

Both above AI reported issues are false-alarm. Please refine the AI-BOT.
And the message he sent didn't reach to me (I'm not in --to list). So the
issue may not be resolved timely.

Thanks,
Xu Yang