Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6075260imm; Mon, 23 Jul 2018 10:58:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf2YsBsO2gjMRFk8uPXRnlrvL9T+vXjlvTjbAVS/fUm24SyXDq9Jx7N2KTPoSWSXGfeaqDP X-Received: by 2002:a63:fa18:: with SMTP id y24-v6mr1798826pgh.362.1532368697119; Mon, 23 Jul 2018 10:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532368697; cv=none; d=google.com; s=arc-20160816; b=JWdzPvdoy3FQ/3bzlM0yPePuiC2SQJmzyn2J9rAp+gQ8tCvNVsl2/lDnoj+9S9aZDm oGLYd+xE9Pb9jltkf+rfIJs2F3hM7Zs5HzwQkrYYsr40yQNadxnNr3f6E/nJPDfHNpSb gr9YVtzCJqViO3sBXP8jAChPhCoh3/hXVUMxjV9+rdRYAhzQRnopkcrCqSWQcpn7w/ln oY08to7gZ9dEYGFPn1Cr/tEVl7yp7CLCApBMlJEsczQRxlCYmoL7u6UT4nw7j9DyKo9P UTQ75FcOWokwnX0hxBSzcMr8KOR6rqw72mLVpb2XEp+6P6TcIEVnGehXpv5HnlM/p0W6 9Suw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :subject:from:cc:to:arc-authentication-results; bh=OUnoG5vlDsRVKQ1w6sdGcbsSJAEDW5uPkR8UdTnNd1M=; b=x3nPswDAltmZVxUqWLZlS0EihKFspAFYC4KMgKgaWYESFh4lTdIP8q6fooYvMCB0U2 UHv0xT0yZ6Ygyykt66hyRtUcL5hYldRz/lDiJ/V2dw+TFpATTITerGeHzbgY+y++W4n6 /LjMUk7OXhC45SRz2yey8FvDaWwgbJTF05uDA2auF1GkJADeGXcAVHl9J4utHrA7ciWE U7FkU9N4t9dExfLYAGRssu6qlq5TK6Jp/Zzwzf5vZOM7quy/xlHEg3xlPEGWgCWe0e/Y cTfCxFSKuT/3aL/G8uRsgC2HXFNwLee+YUDcAZXGy54LhoBECB74DCPiNrZ5pUgfpiQU jMAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si8814989pfb.365.2018.07.23.10.58.02; Mon, 23 Jul 2018 10:58:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388387AbeGWS6s (ORCPT + 99 others); Mon, 23 Jul 2018 14:58:48 -0400 Received: from mail.ispras.ru ([83.149.199.45]:57812 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388212AbeGWS6s (ORCPT ); Mon, 23 Jul 2018 14:58:48 -0400 Received: from [10.10.2.207] (pluton2.ispras.ru [83.149.199.44]) by mail.ispras.ru (Postfix) with ESMTPSA id A0D89540081; Mon, 23 Jul 2018 20:56:24 +0300 (MSK) To: Srinivas Pandruvada Cc: Jiri Kosina , Benjamin Tissoires , Even Xu , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org, Anton Vasilyev From: Anton Vasilyev Subject: HID: intel_ish-hid: tx_buf memory leak on probe/remove Message-ID: Date: Mon, 23 Jul 2018 20:56:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ish_dev_init() allocates 512*176 bytes memory for tx_buf and stores it at &dev->wr_free_list_head.link list on ish_probe(). But there is no deallocation of this memory in ish_remove() and in ish_probe() error path. So current intel-ish-ipc provides 88 KB memory leak for each probe/release. I have two ideas 1) to replace kzalloc allocation by devm_kzalloc, or 2) release memory stored at &dev->wr_free_list_head.link list (and may be at &dev->wr_processing_list_head.link) in all driver exits. But I do not know which way is preferable for this case. Found by Linux Driver Verification project (linuxtesting.org). -- Anton Vasilyev Linux Verification Center, ISPRAS web: http://linuxtesting.org e-mail: vasilyev@ispras.ru