Re: [PATCH for-next 02/11] IB/hfi1: Check return value of strchr before using it

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

 



On 12/20/2017 3:25 AM, Leon Romanovsky wrote:
On Mon, Dec 18, 2017 at 07:56:23PM -0800, Dennis Dalessandro wrote:
The call to strchr in our counter initialization does not check the return
value before attempting to use the pointer. In theory this should not
happen given the way the code is structured but do the smart thing and
check the value anyway to harden the code.

The smartest way is to get rid of the whole "\n"<->"\0" logic and
copy/paste mlx5 implementation which does the same thing but statically
and much safer than here.

Thanks


Not sure I'd agree. Is there something unsafe about the code here? The hole is plugged. Changing the entire implementation for a copy/paste job doesn't seem like a good thing to me.

-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux