]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
minor cleanups
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 26 Jun 2011 15:18:53 +0000 (17:18 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 26 Jun 2011 15:18:53 +0000 (17:18 +0200)
grub-core/net/tftp.c

index d0ed7c43a538fdd4eb889716d6e72a7b24f3f3d3..24f30eb7a95012dff4385b26bcfd23ddb3a623ac 100644 (file)
@@ -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);