You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/12 08:02:29 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6602: risc-v/mpfs: usb: fix illegal reads

pkarashchenko commented on code in PR #6602:
URL: https://github.com/apache/incubator-nuttx/pull/6602#discussion_r918668809


##########
arch/risc-v/src/mpfs/mpfs_usb.c:
##########
@@ -1060,7 +1061,8 @@ static int mpfs_req_read(struct mpfs_usbdev_s *priv,
           privreq = NULL;
         }
 
-      if ((privreq->inflight) && (count != 0))
+      if ((privreq->inflight) && (count != 0) &&
+          (reg & RXCSRL_REG_EPN_RX_PKT_RDY_MASK))

Review Comment:
   Optional
   ```suggestion
         if ((privreq->inflight > 0) && (count != 0) &&
             (reg & RXCSRL_REG_EPN_RX_PKT_RDY_MASK) != 0)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org