From a8fae12c5be48b4dafeec7c47d99132630be51cb Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 26 Jun 2011 17:18:53 +0200 Subject: [PATCH] minor cleanups --- grub-core/net/tftp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c index d0ed7c43a..24f30eb7a 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -131,8 +131,9 @@ tftp_receive (grub_net_socket_t sock, struct grub_net_buff *nb) grub_netbuff_clear (nb); break; case TFTP_DATA: - if ((err = grub_netbuff_pull (nb, sizeof (tftph->opcode) + - sizeof (tftph->u.data.block))) != GRUB_ERR_NONE) + err = grub_netbuff_pull (nb, sizeof (tftph->opcode) + + sizeof (tftph->u.data.block)); + if (err) return err; if (grub_be_to_cpu16 (tftph->u.data.block) == data->block + 1) { @@ -142,8 +143,11 @@ tftp_receive (grub_net_socket_t sock, struct grub_net_buff *nb) sock->status = 2; /* Prevent garbage in broken cards. */ if (size > 1024) - if ((err = grub_netbuff_unput (nb, size - 1024)) != GRUB_ERR_NONE) - return err; + { + err = grub_netbuff_unput (nb, size - 1024); + if (err) + return err; + } } else grub_netbuff_clear (nb);