Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6978102ybi; Wed, 5 Jun 2019 09:14:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdGu4VUZDURRjMOV6kNq4BAOkszuBPpZKw09fwNw+5lGBCoFalS6Zp5fiJqIns84DlqkKv X-Received: by 2002:a17:90a:3ae8:: with SMTP id b95mr9593467pjc.68.1559751266833; Wed, 05 Jun 2019 09:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559751266; cv=none; d=google.com; s=arc-20160816; b=cTzuETw30gC1eXLKyjveqYQERRy7rS/b6g8xM+1x94lQvEXqlkvQG3hWp7N+beVP6B 2iN+D4NSWsTyP9TA8n6v4gyoeGBaTt1B5Hqj78dWYKzYmveXaILzFGa53OlaCzUQTDVH najcwK/afeHmaB4k5wQePX6Lz9itsn9FUWsKqn0iVfWQPwy9pQGyXKr3TI6V/loh6y7n 7cllWXcWKQnDKgInhb1ADJB8NgkU84oqqer3OtOsFDSYdoUz9I75xe/zP+WTQqcYdwFL kj05SUODvp+cEr1C6qVKl09PgsM9oxR6eXo9YJOPE5WlraZEdN8nrgc9+JPuRCIrjArU ikFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GB15BWhJAhFYS24v4xU4U4zTm67QHH55ytl2QpsKhh8=; b=C46rZ9Lb91Y8zfTo6ahskvOQf38ts0KBg88JP+cK2UZ00+Qb/l54Cn5OdHFLnTb456 FXq8yLV0uayIWgbnE2th8dOtIvWx79WT0wR00YVvrKg1T6STxsnAKQEApJVA2F6DKEcJ E5htAvXYLKsVm8Stsuqn6X47bxfCDWi8D7URtpZqN+rwRGx9s6gqT0br8+S/OleCD/g5 OgCOTceds+eIhzJSZw+IPaLH6ntwrnl4MPl06wXp9vFt5bD1YoAr0jWXRftKRMh7Riy7 i2K2NDGHKvoGgFZcZC/b1TlT0l+QcdrACQTB9Q3J3d1kM3IcJt7EfH+/7ypZ0gXU/kWS Z+rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HAfvdFSp; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bo2si19761438pjb.58.2019.06.05.09.14.07; Wed, 05 Jun 2019 09:14:26 -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=@gmail.com header.s=20161025 header.b=HAfvdFSp; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728614AbfFEQLx (ORCPT + 99 others); Wed, 5 Jun 2019 12:11:53 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53655 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728560AbfFEQLx (ORCPT ); Wed, 5 Jun 2019 12:11:53 -0400 Received: by mail-wm1-f67.google.com with SMTP id d17so2841222wmb.3 for ; Wed, 05 Jun 2019 09:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GB15BWhJAhFYS24v4xU4U4zTm67QHH55ytl2QpsKhh8=; b=HAfvdFSpd0tyKLZQCP4QW9gkFu0g7irFnuGdsk7Qc8Dk1Oshi3m4zSYZZGne/7vJs1 lZhGYvtgIhtb/S14QRmxwVO+YWlOd0fwK9QZQVURWjg2egEPdiy0kKsI2/YMvQfBTiSL Nk4AxRpMYHsgtH9Qa2eSAtQUWaEr8+//CIIuNqcKwHc3H4giS+t6pM7kIoWgBSarhCuj msiHbVqe8vtGPFnH9g2tm9hPwTWnJzzg+HwNVuk8Lh1n47rtJAxLkoqtrObq6lcGrSbY tAmxER90lS79+udB8CSGDuTEpDx5RbtjAbXq7HNU+0BRWwiY6Xar2jhkEAbWvdgOttOe 9AbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GB15BWhJAhFYS24v4xU4U4zTm67QHH55ytl2QpsKhh8=; b=Z7+qMtw5EGeX+LVQwPc+mH6z9NasvhGlQjL+06QQBaAkIVBct84qLYvqAFjWmAu+ul NezU/2umZmTR9NC/c1WN/pEQpH+YOSzZyxEkKTNXHkB3YgP0IU0UuKaD0JVIm6qQ8DBX DG6uL3Vu1Ph627XurgKHIh26p/nx0vfsQ6majACCLPu9iduQG0DlIuXqjG84qfURRkft ziyuVj2V8ZqLRKVnlvAAeziJ1PnAq7Qg2MMXxbl8JtR6G/drUfYC5kZedUcpLXY2cfc7 tsXBGZxlyElo73EzzrSiHxFYVm4y8UamohYzEupJLnA3nCfPO2hi2RDjyVyHEyolloqD ZfGw== X-Gm-Message-State: APjAAAW1J3izoIzaQ6tiI6bDrrkIM/7N8cD7VVHmEmzgb39Ton2bWpPD lNaskdk0OStwI2yOCPsltpOijNo9 X-Received: by 2002:a1c:bbc1:: with SMTP id l184mr9550224wmf.111.1559751111398; Wed, 05 Jun 2019 09:11:51 -0700 (PDT) Received: from zhanggen-UX430UQ ([108.61.173.19]) by smtp.gmail.com with ESMTPSA id r131sm10240068wmf.4.2019.06.05.09.11.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 09:11:50 -0700 (PDT) Date: Thu, 6 Jun 2019 00:11:41 +0800 From: Gen Zhang To: Jiri Slaby Cc: inaky.perez-gonzalez@intel.com, linux-wimax@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] wimax: debug: fix a missing-check bug in d_parse_params() Message-ID: <20190605161141.GA4538@zhanggen-UX430UQ> References: <20190530093937.GA4457@zhanggen-UX430UQ> <3f496fad-cfc8-2d13-327f-075011e542fc@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3f496fad-cfc8-2d13-327f-075011e542fc@suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 05, 2019 at 08:33:31AM +0200, Jiri Slaby wrote: > On 30. 05. 19, 11:39, Gen Zhang wrote: > > In d_parse_params(), 'params_orig' is allocated by kstrdup(). It returns > > NULL when fails. So 'params_orig' should be checked. > > > > Signed-off-by: Gen Zhang > > --- > > diff --git a/include/linux/wimax/debug.h b/include/linux/wimax/debug.h > > index aaf24ba..bacd6cb 100644 > > --- a/include/linux/wimax/debug.h > > +++ b/include/linux/wimax/debug.h > > @@ -496,6 +496,11 @@ void d_parse_params(struct d_level *d_level, size_t d_level_size, > > if (_params == NULL) > > return; > > params_orig = kstrdup(_params, GFP_KERNEL); > > + if (!params_orig) { > > + printk(KERN_ERR "%s: can't duplicate string '%s'\n", > > + tag, _params); > > We use pr_err these days. Thanks for your reply. I used printk() because at least in this file, printk() is used. Should I change printk() to pr_err() and revise this patch, or should all printk() in this file be changed? I hope you can give me some specific instructions. Actually I don't know what to do when getting this reply... Thanks Gen > > thanks, > -- > js > suse labs