summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2022-08-30 09:38:12 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-12 12:09:21 +0200
commit46ff23b4468dabf5cec3ca6db1bad8dab4818943 (patch)
tree39a078c18ad83f60e1b36b8aeac411d82af4968c
parent320ce55adcb6bc2c426ec98bd7e97bcbd6873ce1 (diff)
downloadbarebox-46ff23b4468dabf5cec3ca6db1bad8dab4818943.tar.gz
tftp: do not use 'priv->block' for RRQ
attribute is not used outside tftp_recv() for RRQ. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Link: https://lore.barebox.org/20220830073816.2694734-18-enrico.scholz@sigma-chemnitz.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--fs/tftp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/tftp.c b/fs/tftp.c
index 98ac34bf5a..c2f77e3d87 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -429,7 +429,7 @@ static void tftp_recv(struct file_priv *priv,
case TFTP_DATA:
len -= 2;
- priv->block = ntohs(*(uint16_t *)pkt);
+ block = ntohs(*(uint16_t *)pkt);
if (priv->state == STATE_RRQ) {
/* first block received; entered only with non rfc
@@ -444,11 +444,11 @@ static void tftp_recv(struct file_priv *priv,
break;
}
- if (priv->block != (uint16_t)(priv->last_block + 1))
+ if (block != (uint16_t)(priv->last_block + 1))
break;
tftp_timer_reset(priv);
- tftp_put_data(priv, priv->block, pkt + 2, len);
+ tftp_put_data(priv, block, pkt + 2, len);
break;