Hi Eitan,

On Tue, 2006-08-01 at 06:28, Eitan Zahavi wrote:
> Hi Hal
> 
> This was reported to me by Ishai R. 
> 
> Consider function umad_recv line 810:
>       if ((n = read(port->dev_fd, umad, sizeof *mad + *length)) <= 
>            sizeof *mad + *length) {
>               DEBUG("mad received by agent %d length %d", mad->agent_id, n);
>               *length = n - sizeof *mad;
>               return mad->agent_id;
>       }
> 
>       if (n == -EWOULDBLOCK) {
>               if (!errno)
>                       errno = EWOULDBLOCK;
>               return n;
>       }
> 
> Seems that umad.c umad_recv would never go through the second "if" 
> as if the read return n < 0 it will be cought by the first "if".
> 
> Then I have noticed that a wrap around of the returned length is also 
> possible.
> 
> The patch fixes these issue.
> 
> Eitan

Good catches. Thanks. Applied to both trunk and 1.1 branch.

-- Hal



_______________________________________________
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to