Re: [PATCH] synclink fix ldisc buffer argument

From: Chen Gang
Date: Sun Dec 02 2012 - 21:20:01 EST


ä 2012å12æ03æ 04:05, Paul Fulghum åé:
> OK, Iâll do that.
>

pardon (I am just learning)
does 65535 mean HDLC_MAX_FRAME_SIZE ?
why do we need info->max_frame_size >= 4096 ?

in drivers/tty/synclink_gt.c:
3550 if (info->max_frame_size < 4096)
3551 info->max_frame_size = 4096;
3552 else if (info->max_frame_size > 65535)
3553 info->max_frame_size = 65535;
3554
...
3603 info->max_frame_size = 4096;


if possible:
can we move the relative comments (which are inside function) to the
location just above ldisc_receive_buf ?


thanks.

gchen.


> On Dec 2, 2012, at 12:10 PM, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx
> <mailto:alan@xxxxxxxxxxxxxxxxxxx>> wrote:
>
>> On Sun, 2 Dec 2012 10:11:58 -0600
>> Paul Fulghum <paulkf@xxxxxxxxxxxxx <mailto:paulkf@xxxxxxxxxxxxx>> wrote:
>>
>>> True, in this mode line disciplines other than N_HDLC would not be
>>> functional and N_HDLC ignores the flag buffer.
>>> This change wonât make other line disciplines useful, it will just
>>> prevent the case of a mistakenly selected line discipline accessing
>>> beyond the end of the (dummy) flag buffer.
>>>
>>> Iâm fine with or without the change. It is functional now with a
>>> chance to read past then end of a buffer if misconfigured. With the
>>> change, it has the same functionality without the ability to read
>>> past the end of a buffer if misconfigured.
>>
>> With the change its feeding crap in the flags buffer, which may matter in
>> future depending what happens to the other bits.
>>
>> If this is a real issue far better to just kzalloc a blank flag buffer to
>> match the mtu.
>>
>
> --
> Paul Fulghum
> MicroGate Systems, Ltd.
> =Customer Driven, by Design=
> (800)444-1982
> (512)345-7791 (Direct)
> (512)343-9046 (Fax)
> Central Time Zone (GMT -5h)
> www.microgate.com <http://www.microgate.com/>
>


--
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/