Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2375225ybg; Fri, 5 Jun 2020 12:15:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz/SlBapM16delJiFCU1dtndIqxRo8yTvp2v/0yvzDUmdxRNzxh4LB4Rdqv0Mb3IeEABeg X-Received: by 2002:aa7:c245:: with SMTP id y5mr10923094edo.189.1591384559423; Fri, 05 Jun 2020 12:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591384559; cv=none; d=google.com; s=arc-20160816; b=A0E+hBUdj3NwZv5yYwWIwIx/qkEpvef8PQqCVnFmp/zSe9xF3ShiO5OcY9/iRR7kog 8WTFXXjlT3KRdIQSdgjxGutpy/BaYGqni3aAUPnPyOP0FYWXC76dHlBPVoqkK1zcUJG8 68p34vXhxuGwSF71yDO9B2Lvtv+dq4qUQ21/LpSKnFHM2+QrL2Bn/iBmmsYhHpznJk4K B8anev6Z4/oVU3G0bf2fRx0lnHHmXgzJ+IPSmjL01TaFXAFlI5YYXoMV1q5BCd+NuOsK YH8Gk56Yt+O0AQWtiRzh+5986A53LPhlKmGOD5mwc7NytrIeYKxe8DIX8fyINjj5kVwH oFSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=itfl8twhNK2a01fSikoJ1WeP6OOUKm4LjLdSnPiLkNY=; b=WjacFUQ7vLy/QWZIMX/VozcYtajpPonwkCM/rvHj24A7tfWjD/ZuYK/F+IHSTig7Dk v+tyz7JSFAm0trC0EzQ3MR07u20x2xy9eJSWm4IRXKYRU8uAK7Wf8BH+bKI2xeL5vszo frp+mL7QHYQ5bm+KISOgb9NaQbrU6X1AmnyHcq0Xo74ItU30n4XxsMIrzMfhS1dBnpQ+ FuVWX26mQY0NcyydRiSWTDRtAjN05Sem8J1IVGoQmVVZ8tiKVJ1aBdUsLAdFjw+W7UQB YePdxYGJ7IWK8dcAexK/Tj9SX/7MXagkCmaxuAR/jcVXSgqpD9LgpdC9RF3aqRKbeV6a Vgag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si4260035edp.92.2020.06.05.12.15.35; Fri, 05 Jun 2020 12:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727863AbgFETLs (ORCPT + 99 others); Fri, 5 Jun 2020 15:11:48 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37773 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726846AbgFETLs (ORCPT ); Fri, 5 Jun 2020 15:11:48 -0400 Received: by mail-lj1-f194.google.com with SMTP id e4so13104353ljn.4; Fri, 05 Jun 2020 12:11:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=itfl8twhNK2a01fSikoJ1WeP6OOUKm4LjLdSnPiLkNY=; b=iPGdLlR9Z6FpdFTWicTyOsa9xj0CEmNhN0o77X4rFfSmNcUWW4kQ8lhRRqYyhbAOTn ll1sPPHcYhaiXYgUOYFMiJQyH4k65nwiSEPVkXlfMajbB0N6y1zYFv/Evd93HLOsJMON 6ZKzJ5bCnyQq2YuUDdLZstL/y4P21JUYPRPfWHh8RvPXhhtjysxZaI6nbbndQqGBt9hM GYY0EaMrqddRXu7ofuCOhANYlNqJcutYs27eF951sjNupCBbWEGojpq00BZgA9povy8B CMxUBKcoXDfMDwzd5mtIA5SfToQCV8NZnd69bvRZkhtMo9QsBCiwAePSyVn3n5mlCinT AY5w== X-Gm-Message-State: AOAM533b2fMI2a1fhSCpLPfBv6CH6jttO81vmiRW/X/6nBxduGgAzgo1 uRBxQyKPj9xsIyiBH4g/XCQ= X-Received: by 2002:a2e:b5bc:: with SMTP id f28mr4926246ljn.451.1591384305399; Fri, 05 Jun 2020 12:11:45 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-38-130.ip.moscow.rt.ru. [37.110.38.130]) by smtp.googlemail.com with ESMTPSA id 1sm1288171lft.95.2020.06.05.12.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 12:11:44 -0700 (PDT) From: Denis Efremov To: Vishal Kulkarni , "David S. Miller" , Jakub Kicinski Cc: Denis Efremov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cxgb4: Use kfree() instead kvfree() where appropriate Date: Fri, 5 Jun 2020 22:11:44 +0300 Message-Id: <20200605191144.78083-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c index 41315712deb8..828499256004 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c @@ -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; } -- 2.26.2