From patchwork Sun Oct 8 21:30:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 9992013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4FC4260230 for ; Sun, 8 Oct 2017 21:30:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4070928567 for ; Sun, 8 Oct 2017 21:30:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34DA328582; Sun, 8 Oct 2017 21:30:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8FAD28567 for ; Sun, 8 Oct 2017 21:30:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753234AbdJHVaz (ORCPT ); Sun, 8 Oct 2017 17:30:55 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35982 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751561AbdJHVay (ORCPT ); Sun, 8 Oct 2017 17:30:54 -0400 Received: by mail-pf0-f195.google.com with SMTP id z11so5711019pfk.3; Sun, 08 Oct 2017 14:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=e372gs+PQjq2JSVZCK9CXDE4/Ncte+P39a+lFk24CU4=; b=ka+2vi99zQmSNUj6dNJRJMjYEWGccYMDrJQZSzrcgWUmrHHhDjV5nPIO9+gZ8Cmcnk 1AbT5U3QZCogoqSX5r1Em1p30LlwkQyI2+KsunVUfXpbKQi0aELn7yEb/tF3AjbBd91O DVZP16Vys3cOenGFi53/Ly7a61UUyW90pZvukjVoWmoKStv9vC005dLekxf2R81/iPiS HklytKKB2UUYIb9tRgLm3m2h9MCZWISzospooZ7XAo/nrF8IP2iIZeXEr6iSUbsEss7e MCkfgcMswFSNb5jr+FBprvbVFZzHKjX7NVAufm0MPVyMdyj3z9pWiyYHRp4zoRgOHekf Kt0Q== 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; bh=e372gs+PQjq2JSVZCK9CXDE4/Ncte+P39a+lFk24CU4=; b=lRhTixiEfUwDkKUHmjqoQy+0yRDueniw2SdlateFRGGgqi/w8Els3AwBxjEUIa3SL5 /4cqCgXqKnnAReJo0S4i0xrOYNGVMCtWjl3zm3l5REq7drMDWAd6NvYcHslBb6nx/Lxx Sxce1ZBW56Y8zvDv2NTcyObQQOYKJjPRifa8Waj96r2q7hq4Hbd/gl4qbDsSYbr9cmmR QTeY7YHkKGVgH6RNrz8fLiRIXuz3+mO9i/mdn0iDRw2SxBBcLoWEce5VZOn7Txvw+iy9 3PeVPdiQP7DVw22p/BPtoocdS3UppttUwb+qk7F/Db6y29cJYy2eLGFIlKvFzEQ9jgTT yxfg== X-Gm-Message-State: AMCzsaWmCd1AsZ7tkkZ0QClkIs1HosONd0kXhSOxGQf5BCDBltFDwfNN QnqFNI61BtQ8G5uDJjOajqE= X-Google-Smtp-Source: AOwi7QDUXFuqIJKj+L6U08vt4VG/zgiU09lzO8Bg45Cxa6sD094YclwGrs4siItIVHsxvGR/xNWO2w== X-Received: by 10.98.178.22 with SMTP id x22mr3661084pfe.123.1507498253619; Sun, 08 Oct 2017 14:30:53 -0700 (PDT) Received: from localhost.localdomain ([103.254.204.108]) by smtp.gmail.com with ESMTPSA id v69sm13931204pfd.75.2017.10.08.14.30.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Oct 2017 14:30:51 -0700 (PDT) From: Himanshu Jha To: bart.vanassche@wdc.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] skd: Use kmem_cache_free Date: Mon, 9 Oct 2017 03:00:28 +0530 Message-Id: <1507498228-11878-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use kmem_cache_free instead of kfree for freeing the memory previously allocated with kmem_cache_zalloc/kmem_cache_alloc/kmem_cache_node. Signed-off-by: Himanshu Jha Reviewed-by: Bart Van Assche --- drivers/block/skd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index 7cedb42..64d0fc1 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -2604,7 +2604,7 @@ static void *skd_alloc_dma(struct skd_device *skdev, struct kmem_cache *s, return NULL; *dma_handle = dma_map_single(dev, buf, s->size, dir); if (dma_mapping_error(dev, *dma_handle)) { - kfree(buf); + kmem_cache_free(s, buf); buf = NULL; } return buf;