Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp897761ybl; Wed, 14 Aug 2019 07:38:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqytMMv81xls4mF8kpGjDvspI9jEpBzhF7HMstM2orC6tHtHFLJcAaHzsdLZ7QPaxNrBnVbw X-Received: by 2002:a63:4a50:: with SMTP id j16mr38715721pgl.126.1565793535227; Wed, 14 Aug 2019 07:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565793535; cv=none; d=google.com; s=arc-20160816; b=Sje22nTdv/EoRglsGbZuhYa4Zdq6fYZAWVobFTswbTJKtmyGHiUAUFUsJRxCq5f9FX JRzsxqCzzm1CU4Shgf1Ei0fGkzOqIWcExxB2aZl/Hb3vyX4x1ZR8Metr2nW1bpcWyCz4 n3whLimWGfP++kzApwSy7w9V6OvtD08o6URKIzQBXXOWSH2QAlrm43Ex9VkUNetDV69q wvv+Db3Bubf1+fkpbVFxXEL/HYkXmJdKbrQJOwTrXo3ghO4Cq6bqJDl+jc3CaQqFws6d nO5xTZzL3J37MLq8c2K217g8ye50S6+XqmSutz8S7igvACIA/E0PwyCvae7bkWl2gwgS moww== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=2VuOFkpg+OnsxKXnpQLm1eMqS2/9zneI+ldSNXH6EHQ=; b=yRqQs1QbBTUqB6XSuo1QGKMVJsS4sTtjw9QdjyHL2PhOR8M7CPatF8ZkAOj1RVdTvR ofbzQQ82hT7nrf/Ak1bBmOyd3ELkuDNYKfQJd6eNILF87tyM53xygNb4R9iXokQUftAL nz4NHbG72KOekza3KN9uQH59M9CVKR+qD0Bq9E5NfG4ZBHLMUn0JU6gsu7fZLx72FzsK AOikiYAmDkQt1ufNpP15kX4L1zGpIEC2RI0YxkgF/CT+M082p6XyuWNTv4yl6LI9otCp s5bJ8Alao6cjmgp7xanaIXNTKk+cJUBa/DbflZP47DDqflUCGbPw2Qu9RBuhwbLYc1wL 1lXA== 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 q19si6935pjp.10.2019.08.14.07.38.38; Wed, 14 Aug 2019 07:38:55 -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 S1727997AbfHNOhg convert rfc822-to-8bit (ORCPT + 99 others); Wed, 14 Aug 2019 10:37:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:39532 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726157AbfHNOhg (ORCPT ); Wed, 14 Aug 2019 10:37:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7E29EAF98; Wed, 14 Aug 2019 14:37:34 +0000 (UTC) Date: Wed, 14 Aug 2019 16:37:33 +0200 From: Thomas Bogendoerfer To: Jonas Gorski Cc: Ralf Baechle , Paul Burton , James Hogan , Dmitry Torokhov , Lee Jones , "David S. Miller" , Srinivas Kandagatla , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Jiri Slaby , Evgeniy Polyakov , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Network Development , linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v4 9/9] Input: add IOC3 serio driver Message-Id: <20190814163733.82f624e342d061866ba8ff87@suse.de> In-Reply-To: References: <20190809103235.16338-1-tbogendoerfer@suse.de> <20190809103235.16338-10-tbogendoerfer@suse.de> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 14 Aug 2019 15:20:14 +0200 Jonas Gorski wrote: > > + d = devm_kzalloc(&pdev->dev, sizeof(*d), GFP_KERNEL); > > &pdev->dev => dev will change. > > > + if (!d) > > + return -ENOMEM; > > + > > + sk = kzalloc(sizeof(*sk), GFP_KERNEL); > > any reason not to devm_kzalloc this as well? Then you won't need to > manually free it in the error cases. it has different life time than the device, so it may not allocated via devm_kzalloc > > +static int ioc3kbd_remove(struct platform_device *pdev) > > +{ > > + struct ioc3kbd_data *d = platform_get_drvdata(pdev); > > + > > + devm_free_irq(&pdev->dev, d->irq, d); > > + serio_unregister_port(d->kbd); > > + serio_unregister_port(d->aux); > > + return 0; > > +} > > and on that topic, won't you need to kfree d->kbd and d->aux here? that's done in serio_release_port() by the serio core. Thomas. -- SUSE Linux GmbH GF: Felix Imend?rffer, Mary Higgins, Sri Rasiah HRB 21284 (AG N?rnberg)