cxgb4: Use kfree() instead kvfree() where appropriate
authorDenis Efremov <efremov@linux.com>
Fri, 5 Jun 2020 19:11:44 +0000 (22:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jun 2020 20:22:49 +0000 (13:22 -0700)
Use kfree(buf) in blocked_fl_read() because the memory is allocated with
kzalloc(). Use kfree(t) in blocked_fl_write() because the memory is
allocated with kcalloc().

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c

index 4131571..8284992 100644 (file)
@@ -3357,7 +3357,7 @@ static ssize_t blocked_fl_read(struct file *filp, char __user *ubuf,
                       adap->sge.egr_sz, adap->sge.blocked_fl);
        len += sprintf(buf + len, "\n");
        size = simple_read_from_buffer(ubuf, count, ppos, buf, len);
-       kvfree(buf);
+       kfree(buf);
        return size;
 }
 
@@ -3374,12 +3374,12 @@ static ssize_t blocked_fl_write(struct file *filp, const char __user *ubuf,
 
        err = bitmap_parse_user(ubuf, count, t, adap->sge.egr_sz);
        if (err) {
-               kvfree(t);
+               kfree(t);
                return err;
        }
 
        bitmap_copy(adap->sge.blocked_fl, t, adap->sge.egr_sz);
-       kvfree(t);
+       kfree(t);
        return count;
 }