Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp667839yba; Mon, 1 Apr 2019 14:18:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8j9JvhedzTj4ndrIRFR30PGqcucOs6gO7NpzLkpgV2CcvnfbkeAXLTxa+Y+ITFkmBkUmY X-Received: by 2002:a17:902:7247:: with SMTP id c7mr47436554pll.255.1554153497332; Mon, 01 Apr 2019 14:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554153497; cv=none; d=google.com; s=arc-20160816; b=veLzLeHGZ0uN97gjuDjhvyjmSUtidobt300D4AGhdk6lNpsfC5YXXsUoVJGmdn6R7o gAvFt9AmQFHYODwGyKb61rfQUhYsCs8/xG7X3oxkjdTFfavcCmpBQyS4oacllHvoo0w0 W2uh18YBbcrz9Ybkrc0nfCdJUYmhu2duh+SjWmzzRMNFv1eLbEJWVOCTr+9UuoH+OlUS UnGpQ+sWXH5g5MF8ORevoqiT7e2B5FjOuad7rwhWAGQKr3iIUfWSeN/xiGSZYREljuRC TWeN6Cd9UR3LaAmUZzhJbN3chhAMU0ozEzncQVmDCEyJ11Nt8c28mvucbWwmGzi1XspA s9Pw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=NU/dwlFy06P3CY+Snl/xjOq1oiT4xOTpJ/q7qEv6+mc=; b=jkwgdQ++kLJjh6qOFoOcUnl4b8HI//Z/XaKQ2BJnu58jhOKOuzlwIXiiTLELfJ/XEZ Z8RyO9GzMEHKcm85C0DfziTNyG47n51mfAEMGiLnCnN1acmZwekVMgEgJSEqpOqmvGqA XVrTz79lImwJtGbXCIhsfMEM9+JGfHGwbL/4gOlaBf6uQhl2o1FJiMIVWS93ZG9vcqD/ SIzh0ACVnffiyCjfQXnpbvmcew+uGYrp6XF7DPatnXRWENmEk86+myRNL1xn8nedznER TJuXKCeAliiuyKz9DN1YuuDueOWj3+r3F8SP4sBzv6C2Kw5q9FxDc2ipWLnlzCg0cSCJ 6Z2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jK3Ul6IV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q78si8246039pgq.321.2019.04.01.14.18.01; Mon, 01 Apr 2019 14:18: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; dkim=pass header.i=@chromium.org header.s=google header.b=jK3Ul6IV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728019AbfDAVR1 (ORCPT + 99 others); Mon, 1 Apr 2019 17:17:27 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:43543 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbfDAVR0 (ORCPT ); Mon, 1 Apr 2019 17:17:26 -0400 Received: by mail-ot1-f68.google.com with SMTP id u15so9980807otq.10 for ; Mon, 01 Apr 2019 14:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=NU/dwlFy06P3CY+Snl/xjOq1oiT4xOTpJ/q7qEv6+mc=; b=jK3Ul6IVqM+e6MyG4Hha49qd0Ku9PjgOWY9QsuD3DNOyzYDX4dfQe5qfISFuZWeN07 IxMIbLCjKNOrifeFWQ20PAO89fAb+ABVzBB04Xr/bWAsTelYbrFh312wbmVRpAVbjifc IHpe3TYUGV613jc6NDXKmrRIQgQKPCTPsZbr0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=NU/dwlFy06P3CY+Snl/xjOq1oiT4xOTpJ/q7qEv6+mc=; b=VAn+Z4hoI86NwCIZ8mQqBkI684mizcWNtFLVgSTsyUY2rh8LdEk2Enjd/Zjmxrta+4 Mnv6Cxdas5MUDGRZDCmzPOa1PHMTy0jzY+MZukp1Wz7/miIwtYkKFSujslVUHRKnWopG +Z2ROoIyhTIvDgiqCMxMdyvEdK2Yidx/8Jhlrdg/OWJpy5tTbzCLwUfcLuss8IUmh68p NiBGEe4uqhSjOzctdk5yFQdCfBWctZY2+IVAFRX93aJ23QtPonof5iuPw540aIh02Swc DKZu7quZdUFUB/+cz12UQ1bg4KX3eLpgnMAiwZp4sJCZfJrdV+Swq+MNsy0MEebmfFsy 0KaQ== X-Gm-Message-State: APjAAAWWKMxgbCRo0ldF15BjO1kP2xf/pMG7qwSPD/u6T/n5DeNYyhad 7u34DA9JFl/cGaEcsoNQrMRWGmz9fL0= X-Received: by 2002:a9d:64c1:: with SMTP id n1mr14718328otl.259.1554153445771; Mon, 01 Apr 2019 14:17:25 -0700 (PDT) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com. [209.85.210.45]) by smtp.gmail.com with ESMTPSA id e186sm4610837oia.44.2019.04.01.14.17.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 14:17:25 -0700 (PDT) Received: by mail-ot1-f45.google.com with SMTP id e5so9985884otk.12 for ; Mon, 01 Apr 2019 14:17:24 -0700 (PDT) X-Received: by 2002:a9d:645a:: with SMTP id m26mr2202525otl.304.1554153444460; Mon, 01 Apr 2019 14:17:24 -0700 (PDT) MIME-Version: 1.0 References: <1553889813-17677-1-git-send-email-rushikesh.s.kadam@intel.com> <20190330102230.GB19202@intel.com> In-Reply-To: From: Nick Crews Date: Mon, 1 Apr 2019 15:17:13 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] HID: intel-ish-hid: ISH firmware loader client driver To: Joe Perches Cc: Rushikesh S Kadam , Srinivas Pandruvada , benjamin.tissoires@redhat.com, jikos@kernel.org, jettrink@chromium.org, Gwendal Grignou , linux-kernel , linux-input@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I tried to send the last message from my phone, and surprise it wasn't formatted correctly, so it may have been marked as spam. repeating myself again... Ah, I guess I was wrong about logging OOM. I hadn=E2=80=99t hear about the recommendations against it, but they make sense. Thanks for the clarifications! On Sat, Mar 30, 2019 at 10:27 AM Joe Perches wrote: > > On Sat, 2019-03-30 at 15:52 +0530, Rushikesh S Kadam wrote: > > On Fri, Mar 29, 2019 at 04:30:18PM -0700, Nick Crews wrote: > > > On Fri, Mar 29, 2019 at 1:03 PM Rushikesh S Kadam > > > wrote: > > > > + ldr_xfer_ipc_frag =3D kzalloc(LOADER_SHIM_IPC_BUF_SIZE, GFP= _KERNEL); > > > > + if (!ldr_xfer_ipc_frag) { > > > Log error here. > > The error code is logged in calling function > > load_fw_from_host(). Is that good enough? > > > > I believe the checkpatch script too, would > > recommend against adding debug print for ENOMEM > > error. > > The generic kernel allocation functions already do > a dump_stack() on OOM conditions when called without > __GFP_NOWARN so any additional OOM message isn't > particularly useful. > > > Again, I thought it was against practise to log > > "out of memory" debug prints in probe() > > Or anywhere else given the generic OOM stack dump. > > > But will add if you tell me this is the right way. > > > > > > + return -ENOMEM; > > > > + > > > > + loader_ishtp_cl =3D ishtp_cl_allocate(cl_device); > > > > + if (!loader_ishtp_cl) > > > > > > log error here > > The ishtp_cl_allocate function just calls kmalloc then > initializes the struct so an additional OOM message > isn't useful here either. > >