]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
6pack: remove sixpack::rbuff
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Thu, 8 Aug 2024 10:35:43 +0000 (12:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 06:25:21 +0000 (08:25 +0200)
It's unused (except allocation and free).

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: linux-hams@vger.kernel.org
Cc: netdev@vger.kernel.org
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20240808103549.429349-8-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hamradio/6pack.c

index 6ed38a3cdd734ecaa50afeaa20408001f284664f..29906901a73447e086cd771013862c415af288b9 100644 (file)
@@ -88,7 +88,6 @@ struct sixpack {
        struct net_device       *dev;           /* easy for intr handling  */
 
        /* These are pointers to the malloc()ed frame buffers. */
-       unsigned char           *rbuff;         /* receiver buffer      */
        int                     rcount;         /* received chars counter  */
        unsigned char           *xbuff;         /* transmitter buffer   */
        unsigned char           *xhead;         /* next byte to XMIT */
@@ -544,7 +543,7 @@ static inline int tnc_init(struct sixpack *sp)
  */
 static int sixpack_open(struct tty_struct *tty)
 {
-       char *rbuff = NULL, *xbuff = NULL;
+       char *xbuff = NULL;
        struct net_device *dev;
        struct sixpack *sp;
        unsigned long len;
@@ -574,10 +573,8 @@ static int sixpack_open(struct tty_struct *tty)
 
        len = dev->mtu * 2;
 
-       rbuff = kmalloc(len + 4, GFP_KERNEL);
        xbuff = kmalloc(len + 4, GFP_KERNEL);
-
-       if (rbuff == NULL || xbuff == NULL) {
+       if (xbuff == NULL) {
                err = -ENOBUFS;
                goto out_free;
        }
@@ -586,7 +583,6 @@ static int sixpack_open(struct tty_struct *tty)
 
        sp->tty = tty;
 
-       sp->rbuff       = rbuff;
        sp->xbuff       = xbuff;
 
        sp->mtu         = AX25_MTU + 73;
@@ -631,7 +627,6 @@ static int sixpack_open(struct tty_struct *tty)
 
 out_free:
        kfree(xbuff);
-       kfree(rbuff);
 
        free_netdev(dev);
 
@@ -676,7 +671,6 @@ static void sixpack_close(struct tty_struct *tty)
        del_timer_sync(&sp->resync_t);
 
        /* Free all 6pack frame buffers after unreg. */
-       kfree(sp->rbuff);
        kfree(sp->xbuff);
 
        free_netdev(sp->dev);