usb: ohci-hcd: Null check lurb_priv before dereference

When a variable needs a null check before it is dreferenced ensure that
this is done even in the case of assignment on declaration. This was not
happening for lurb_priv so correct it.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
This commit is contained in:
Andrew Goodbody
2025-09-30 10:56:02 +01:00
committed by Marek Vasut
parent 76d3b66531
commit 08f4c52c97

View File

@@ -1040,9 +1040,11 @@ static void dl_transfer_length(td_t *td)
static void check_status(td_t *td_list)
{
urb_priv_t *lurb_priv = td_list->ed->purb;
int urb_len = lurb_priv->length;
__u32 *phwHeadP = &td_list->ed->hwHeadP;
int cc;
int cc, urb_len;
if (lurb_priv)
urb_len = lurb_priv->length;
cc = TD_CC_GET(m32_swap(td_list->hwINFO));
if (cc) {