Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6368680ybi; Tue, 4 Jun 2019 23:35:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0xtqu7oFpNlaFD+wkWyxOzZjfCkmEsIAMO1xIjOAnNaIV2YG60n5IagJN7rn34BzDTlmv X-Received: by 2002:a17:90a:b30a:: with SMTP id d10mr16988489pjr.8.1559716547720; Tue, 04 Jun 2019 23:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559716547; cv=none; d=google.com; s=arc-20160816; b=uB20UVILHKV8CjH8/KOq9EAdDigrbMU9X3hmtqFOvA8TS261eC8Y79PJyXw/KwO0If 6PrnVflXNL+69fBNL+bW4aqOQNTZ7I64a493wZ0vCVRJmMbWtN9XqO/gKAZxbWhzJCBT mdzCriGazPRCz451eGjBJL628FjfSCULSrPEAIq70w41rcc5/i6bIG48qzVC3qqf01A3 Nf3S0vUlfWlLGLKrgq5CGrj9kS6KdlRsKiVp+u8VKAi8EfukCkhJANOZ+NRcO3dT4yCj o0M2PQKI41bClfPGaIyBoA2q18BTJjuSocHALVO85Wp99MYs4yuDI4DfHhNBtFZ2leGN zm2w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=T2h/VGqAjRwICZp+0RJbdCUtuNW9WWi5WBRX/OLF/0Q=; b=BegfPIFzJNqFozs5xDdDUI4uU7cdcMLHyV4wPBS7NdmL4W7n/+VqJdkOJeq2dc7bkE cjOJowCA0w0J8FN5TcNFRgFCllCxvGdMGZ9kqOHuEcZzSTIpmOl/Xi5SjthEJD3z55Hc pTerALMgK2geS9Cau5nPfZY7Gvh2IYJcp8FAxzxZdjofcU/ukYuTjCrQnNpcq2xAKCQN yXjLFuT0vhchhGK9nIrQpkIDlMVGkTAZgbubvCuSdPyB3oCeFykCUPn2EBUuWpoaWKw2 hGfxwPph2Sn5OHSCp7Wj9hiRLiMjzd4HLQcRUYOPLiLw5cQrtVCkBG2j3VN7TgTLfAK2 gLew== 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 h3si24384170pjs.104.2019.06.04.23.35.30; Tue, 04 Jun 2019 23:35:47 -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 S1726589AbfFEGdg (ORCPT + 99 others); Wed, 5 Jun 2019 02:33:36 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36084 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbfFEGdg (ORCPT ); Wed, 5 Jun 2019 02:33:36 -0400 Received: by mail-wm1-f65.google.com with SMTP id v22so985991wml.1 for ; Tue, 04 Jun 2019 23:33:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=T2h/VGqAjRwICZp+0RJbdCUtuNW9WWi5WBRX/OLF/0Q=; b=H1jv+fpaODWNUYVFHAzy02G2UU/RluusDC8wGSL1KBiBe88adbnj2QmFIBZN2kYw+w YXonpkXhLwGMuIQUiaYCMXbq/eeg23Rqn7OddN2H45r/WGVWPe7XvdzvlxI4T9lWWT/e rwufYDvESv9qdq8tBYgbphwChjbgLuLA61A8gr8X3LmEtPRN+Dq1r6adUUG/JwlZSv4M zMMdup/+K2QcM+Uxxzn3emYylnsxYcbG6m4az/YuZZYhOi3sUxOhYhjThpmTwEEZaxCH VHZZ5E1TDXQgeuptMY8UqA8SB0k2BSfrMzDAIybup0TtOaLihEwWAn72klG/rDvl7jmG a+EA== X-Gm-Message-State: APjAAAXtsHh0a24LM8Cq/fCxLeYsxZrTZCwET5IipT//T1EE14Ix5y1N OFEyImrOU+gYb8dhiujKkhAryaTI X-Received: by 2002:a7b:c5d1:: with SMTP id n17mr20973068wmk.84.1559716413482; Tue, 04 Jun 2019 23:33:33 -0700 (PDT) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id h21sm16836144wmb.47.2019.06.04.23.33.32 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 23:33:32 -0700 (PDT) Subject: Re: [PATCH] wimax: debug: fix a missing-check bug in d_parse_params() To: Gen Zhang , inaky.perez-gonzalez@intel.com Cc: linux-wimax@intel.com, linux-kernel@vger.kernel.org References: <20190530093937.GA4457@zhanggen-UX430UQ> From: Jiri Slaby Openpgp: preference=signencrypt Autocrypt: addr=jslaby@suse.cz; prefer-encrypt=mutual; keydata= mQINBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEt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6iTx4AMFt+a6Z6uH/xGE8pG5NbGtd02r+m7SfuEDoG3Hs1iMGecPyV XxCVvSV6dwRQFc0UOZ1a6ywwCWfGOYqFnJvfSbUiCMV8bfRSWhnNQYLIuSv/nckyi8CzCYIg c21cfBvnwiSfWLZTTj1oWyj5a0PPgGOdgGoIvVjYXul3yXYeYOqbYjiC5t99JpEeIFupxIGV ciMk6t3pDrq7n7Vi/faqT+c4vnjazJi0UMfYnnAzYBa9+NkfW0w5W9Uy7kW/v7SffH/2yFiK 9HKkJqkN9xYEYaxtfl5pelF8idoxMZpTvCZY7jhnl2IemZCBMs6s338wS12Qro5WEAxV6cjD VSdmcD5l9plhKGLmgVNCTe8DPv81oDn9s0cIRLg9wNnDtj8aIiH8lBHwfUkpn32iv0uMV6Ae sLxhDWfOR4N+wu1gzXWgLel4drkCJcuYK5IL1qaZDcuGR8RPo3jbFO7Y Message-ID: <3f496fad-cfc8-2d13-327f-075011e542fc@suse.cz> Date: Wed, 5 Jun 2019 08:33:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190530093937.GA4457@zhanggen-UX430UQ> Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- js suse labs