lkml.org 
[lkml]   [2006]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjecta minor bug in via-rhine driver for linux
Hi:

kernel source version : 2.6.14

file : drivers/net/via-rhine.c

function : alloc_tbufs(), line 1021~1039

problem line : 1035
rp->tx_buf[i] = &rp->tx_bufs[i * PKT_BUF_SZ];

fix: line 1035 should be
if ( rp->quirks & rqRhineI )
rp->tx_buf[i] = &rp->tx_bufs[i * PKT_BUF_SZ];

explaination:
line 718 : here we set rqRhineI flag only for old chips
line 922 : here we allocate buffers and alloc rp->tx_bufs only when
rqRhineI flag setted.
line 1035: here we initialize buffers, but set rp->tx_buf[] based on
tx_bufs anyway.
line 1273: here we use the buffers and refer rp->tx_buf[] only when
rqRhineI flag setted.
Currently, line 1035 does not cause any invalid memory accessing but
calculating and saving some invalid memory address.

comments:
I'm reading this driver and line 1035 confused me for a moment.



--
Best Regards!

Yang Wu

Mobile Phone: +86-013636674084
WorldWideWeb: http://www.pinxue.net

--
Best Regards!

Yang Wu

Mobile Phone: +86-013636674084
WorldWideWeb: http://www.pinxue.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-04 16:42    [W:0.273 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site