Thread (39 messages) 39 messages, 7 authors, 2025-08-15

Re: [PATCH v3 3/5] net: rnpgbe: Add basic mbx ops support

From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-08-14 23:56:22
Also in: linux-doc, lkml

+int mucse_read_mbx(struct mucse_hw *hw, u32 *msg, u16 size)
+{
+	struct mucse_mbx_info *mbx = &hw->mbx;
+
+	/* limit read size */
+	min(size, mbx->size);
+	return mbx->ops->read(hw, msg, size);
As well as the obvious bug pointed out by others, isn't this condition
actually indicating a bug somewhere else? If size is bigger than
mbx->size, the caller is broken. You probably want a dev_err() here,
and return -EINVAL, so you get a hint something else is broken
somewhere.

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help