* Altera TSE (altera_tse) - tx_fifo_depth init bug
@ 2015-01-27 21:26 Vlastimil Setka
2015-01-29 22:22 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Vlastimil Setka @ 2015-01-27 21:26 UTC (permalink / raw)
To: vbridger, netdev, rfi
Hello,
I have discovered a bug in Altera TSE (altera_tse) ethernet driver.
In altera_tse_main.c, function altera_tse_probe:
if (of_property_read_u32(pdev->dev.of_node, "tx-fifo-depth",
&priv->rx_fifo_depth)) {
the TX related "tx-fifo-depth" is read from device tree, but by mistake
written to RX related struct member rx_fifo_depth instead of correct
tx_fifo_depth.
https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/altera/altera_tse_main.c#L1401
I am not sure about impact of this bug, but it seems that
priv->tx_fifo_depth is left uninitialised which is definitely not OK.
[PATCH 1/1] Altera TSE: Fix priv->tx_fifo_depth initialization
This patch fixes priv->tx_fifo_depth initialization in altera_tse_probe().
The "tx-fifo-depth" attribute was read again into rx_fifo_depth instead
of correct tx_fifo_depth probably because of copy-and-paste typo,
and tx_fifo_depth was left uninitialised.
Signed-off-by: Vlastimil Setka <setka@vsis.cz>
---
drivers/net/ethernet/altera/altera_tse_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c
b/drivers/net/ethernet/altera/altera_tse_main.c
index 760c72c..f3d784a 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1399,7 +1399,7 @@ static int altera_tse_probe(struct platform_device
*pdev)
}
if (of_property_read_u32(pdev->dev.of_node, "tx-fifo-depth",
- &priv->rx_fifo_depth)) {
+ &priv->tx_fifo_depth)) {
dev_err(&pdev->dev, "cannot obtain tx-fifo-depth\n");
ret = -ENXIO;
goto err_free_netdev;
--
1.8.1.2
Regards,
Vlastimil Setka
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Altera TSE (altera_tse) - tx_fifo_depth init bug
2015-01-27 21:26 Altera TSE (altera_tse) - tx_fifo_depth init bug Vlastimil Setka
@ 2015-01-29 22:22 ` David Miller
2015-02-16 22:43 ` Vlastimil Setka
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2015-01-29 22:22 UTC (permalink / raw)
To: setka; +Cc: vbridger, netdev, rfi
Your patch was corrupted by your email client, in particular TAB
characters were transformed into a series of SPACE characters.
You must fix your outgoing emails so that this doesn't happen,
and you should send a test email to yourself and make sure that
you yourself can apply successfully the patch in that email
before trying to resend it here.
Thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Altera TSE (altera_tse) - tx_fifo_depth init bug
2015-01-29 22:22 ` David Miller
@ 2015-02-16 22:43 ` Vlastimil Setka
2015-02-20 20:17 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Vlastimil Setka @ 2015-02-16 22:43 UTC (permalink / raw)
To: davem; +Cc: netdev, vbridger
> Your patch was corrupted by your email client, in particular TAB
> characters were transformed into a series of SPACE characters.
Hello,
sorry for inconvenience, here is a correct patch:
[PATCH 1/1] Altera TSE: Fix priv->tx_fifo_depth initialization
This patch fixes priv->tx_fifo_depth initialization in altera_tse_probe().
The "tx-fifo-depth" attribute was read again into rx_fifo_depth instead of
correct tx_fifo_depth probably because of copy-and-paste typo,
and tx_fifo_depth was left uninitialised.
Signed-off-by: Vlastimil Setka <setka@vsis.cz>
---
drivers/net/ethernet/altera/altera_tse_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 760c72c..f3d784a 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1399,7 +1399,7 @@ static int altera_tse_probe(struct platform_device *pdev)
}
if (of_property_read_u32(pdev->dev.of_node, "tx-fifo-depth",
- &priv->rx_fifo_depth)) {
+ &priv->tx_fifo_depth)) {
dev_err(&pdev->dev, "cannot obtain tx-fifo-depth\n");
ret = -ENXIO;
goto err_free_netdev;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Altera TSE (altera_tse) - tx_fifo_depth init bug
2015-02-16 22:43 ` Vlastimil Setka
@ 2015-02-20 20:17 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-02-20 20:17 UTC (permalink / raw)
To: setka; +Cc: netdev, vbridger
From: Vlastimil Setka <setka@vsis.cz>
Date: Mon, 16 Feb 2015 23:43:15 +0100
>> Your patch was corrupted by your email client, in particular TAB
>> characters were transformed into a series of SPACE characters.
>
> Hello,
> sorry for inconvenience, here is a correct patch:
This is not the correct way to submit a patch.
You should never provide a patch for us to apply as a reply to another
email.
Instead you should always make a fresh, new, mailing list posting.
Your Subject line and message body should contain only the exact
text you want to appear in the commit message. You should not
include things like "Hello, " or other trivialities that would
need to be edited out.
Also, your Subject line should be of the form:
$subsystem: $description
Where subsystem is the most specific name of the area you're
changing, in lowercase letters.
You should not use multi-word sequences as you have to state
the subsystem. Simply "altera_tse: " is completely sufficient.
The most annoying thing about seeing the errors you are making is that
if you simply mimicked at how other driver maintainers arrange their
subject lines and message bodies, you would end up doing the right
thing.
Use what other people do as a guide, and don't try to do things in
a special or unique way.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-20 20:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-27 21:26 Altera TSE (altera_tse) - tx_fifo_depth init bug Vlastimil Setka
2015-01-29 22:22 ` David Miller
2015-02-16 22:43 ` Vlastimil Setka
2015-02-20 20:17 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).