From: Masato Asou <[email protected]>
Date: Tue, 13 Dec 2022 18:26:22 +0900 (JST)

Delete #define VMT_DEBUG
ok?
--
ASOU Masato

> comment, ok?
> --
> ASOU Masato
> 
> Index: sys/dev/pv/vmt.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pv/vmt.c,v
> retrieving revision 1.27
> diff -u -p -r1.27 vmt.c
> --- sys/dev/pv/vmt.c  3 Dec 2022 10:57:04 -0000       1.27
> +++ sys/dev/pv/vmt.c  13 Dec 2022 09:23:57 -0000
> @@ -259,6 +259,7 @@ struct vmt_softc {
>       char                    *sc_nic_info;
>  };
>  
> +#define VMT_DEBUG
>  #ifdef VMT_DEBUG
>  #define DPRINTF(_arg...)     printf(_arg)
>  #else
> @@ -534,7 +535,7 @@ vmt_kvop(void *arg, int op, char *key, c
>               DPRINTF("%s: unable to send rpci command\n", DEVNAME(sc));
>               sc->sc_rpc_error = 1;
>               error = EIO;
> -             goto done;
> +             goto close;
>       }
>  
>       if (vm_rpc_get_length(&rpci, &rlen, &ack) != 0) {
> @@ -542,13 +543,13 @@ vmt_kvop(void *arg, int op, char *key, c
>                   DEVNAME(sc));
>               sc->sc_rpc_error = 1;
>               error = EIO;
> -             goto done;
> +             goto close;
>       }
>  
>       if (rlen > 0) {
>               if (rlen + 1 > valuelen) {
>                       error = EMSGSIZE;
> -                     goto done;
> +                     goto close;
>               }
>  
>               if (vm_rpc_get_data(&rpci, value, rlen, ack) != 0) {
> @@ -556,20 +557,23 @@ vmt_kvop(void *arg, int op, char *key, c
>                           DEVNAME(sc));
>                       sc->sc_rpc_error = 1;
>                       error = EIO;
> -                     goto done;
> +                     goto close;
>               }
>               /* test if response success  */
>               if (rlen < 2 || value[0] != '1' || value[1] != ' ') {
>                       DPRINTF("%s: host rejected command: %s\n", DEVNAME(sc),
>                           buf);
>                       error = EINVAL;
> -                     goto done;
> +                     goto close;
>               }
>               /* skip response that was tested */
>               bcopy(value + 2, value, valuelen - 2);
>               value[rlen - 2] = '\0';
>       }
>  
> + close:
> +     if (vm_rpc_close(&rpci) != 0)
> +                DPRINTF("%s: unable to close rpci channel\n", DEVNAME(sc));
>   done:
>       free(buf, M_TEMP, bufsz);
>       return (error);

Index: sys/dev/pv/vmt.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/vmt.c,v
retrieving revision 1.27
diff -u -p -r1.27 vmt.c
--- sys/dev/pv/vmt.c    3 Dec 2022 10:57:04 -0000       1.27
+++ sys/dev/pv/vmt.c    13 Dec 2022 10:23:45 -0000
@@ -534,7 +534,7 @@ vmt_kvop(void *arg, int op, char *key, c
                DPRINTF("%s: unable to send rpci command\n", DEVNAME(sc));
                sc->sc_rpc_error = 1;
                error = EIO;
-               goto done;
+               goto close;
        }
 
        if (vm_rpc_get_length(&rpci, &rlen, &ack) != 0) {
@@ -542,13 +542,13 @@ vmt_kvop(void *arg, int op, char *key, c
                    DEVNAME(sc));
                sc->sc_rpc_error = 1;
                error = EIO;
-               goto done;
+               goto close;
        }
 
        if (rlen > 0) {
                if (rlen + 1 > valuelen) {
                        error = EMSGSIZE;
-                       goto done;
+                       goto close;
                }
 
                if (vm_rpc_get_data(&rpci, value, rlen, ack) != 0) {
@@ -556,20 +556,23 @@ vmt_kvop(void *arg, int op, char *key, c
                            DEVNAME(sc));
                        sc->sc_rpc_error = 1;
                        error = EIO;
-                       goto done;
+                       goto close;
                }
                /* test if response success  */
                if (rlen < 2 || value[0] != '1' || value[1] != ' ') {
                        DPRINTF("%s: host rejected command: %s\n", DEVNAME(sc),
                            buf);
                        error = EINVAL;
-                       goto done;
+                       goto close;
                }
                /* skip response that was tested */
                bcopy(value + 2, value, valuelen - 2);
                value[rlen - 2] = '\0';
        }
 
+ close:
+       if (vm_rpc_close(&rpci) != 0)
+                DPRINTF("%s: unable to close rpci channel\n", DEVNAME(sc));
  done:
        free(buf, M_TEMP, bufsz);
        return (error);

Reply via email to