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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 15, 2025 at 01:55:42AM +0200, Andrew Lunn wrote:
> > +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
> 

Ok, the caller is broken when size is bigger than mbx->size. I will use
dev_err here in v5 since I had sent v4 before this mail.
By the way, how long should I wait before sending the new version? If it
is too frequent, it might cause reviewers to check old versions and miss
feedback, link what happened with this mail. And if it is too long, it
is easy to miss the 'open window'....

Thanks for your feedback.





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux