From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id 2CAFE1F0366; Mon, 19 Jun 2017 01:39:29 -0400 (EDT) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by befuddled.reisers.ca (Postfix) with ESMTPS id AF30A1F035D for ; Mon, 19 Jun 2017 01:39:27 -0400 (EDT) Received: by mail-wm0-x244.google.com with SMTP id f90so14787983wmh.0 for ; Sun, 18 Jun 2017 22:39:27 -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=8kLnnVGwFwHA7rn9ugkmGHhbnfR9XwgwAfMO9wgVwIA=; b=NPDNDh2wpMH+W6ae3NIr/znkwhaZA41G3tJ38kMvGqiBLD2/WogVsG7G3Qgyt832xe GMBT+p+U2UbIpTxPzrSJvQbLyM6bPyib3xA5JN1TQrp1arYvfSDXFNI5PhhTgl5dmlFR UTc87+B60MPWumuC2kgUNnmu0m540y1PYN8SjZugpZfS4VvV+joRXksFbtCj4nq9k0cW zMLdV4WCu4w6V2q81lWGA37l9MBX+5ZgVzOsOjwC+PkzHqLtrcpy0qIyythJDB9+cKsU xcsD+suunyMwzxn+UVdGJkMSV0WuVGjweShzha3I79OZ5gg0tto6T56GDIytrP3W8DF7 tt0g== 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=8kLnnVGwFwHA7rn9ugkmGHhbnfR9XwgwAfMO9wgVwIA=; b=Z/ufilhJ3W937PVZ63upxu4/Q/mD34n6x3XiY6PdSoHjRWZIcP2jwnhtMrDoN5oqrk xuiZmgYiAHVuK4jjehVfddZGanGliWg8UAdkilf+kEqYEvBMlyhXsaHbj2TNrlZTO1Wx xTLvo2sCx0i8qv4/Hr400JBMbV4OOXVWsY6HGCiWUwvkAREEHVewp2hYjnlgHYGtFS3P aBR+ZhQ8Z19g8e8oZREaPdFH2rWI3nHblWMHTCgKtL4aDtfZmJ0HeX4i1V5JuhDhGQde xdywgXhhl1QzdXIe+ZlMAF1QUI5G9SMzHS1uLaAodYLQuthlr8+No9JChFkRPTFSc8Oz +cUw== X-Gm-Message-State: AKS2vOzgXvEuGy/108b2lidgC532A8R/hqUGnq6Jh5EP4RuwHpEVgX5+ /qJnfTA/MAgHSw== X-Received: by 10.28.51.199 with SMTP id z190mr5183158wmz.103.1497850763900; Sun, 18 Jun 2017 22:39:23 -0700 (PDT) Received: from sanghar ([2a00:23c4:7320:5900:224:d6ff:fe76:7136]) by smtp.gmail.com with ESMTPSA id p8sm7153906wrd.57.2017.06.18.22.39.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Jun 2017 22:39:23 -0700 (PDT) Date: Mon, 19 Jun 2017 06:39:21 +0100 From: Okash Khawaja To: Greg Kroah-Hartman Cc: Jiri Slaby , Samuel Thibault , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Kirk Reiser , speakup@linux-speakup.org, Chris Brannon Subject: Re: [patch v2 2/3] staging: speakup: check and convert dev name or ser to dev_t Message-ID: <20170619053921.GA389@sanghar> References: <20170618085825.601359240@gmail.com> <20170618093536.021961426@gmail.com> <20170619011533.GA11287@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170619011533.GA11287@kroah.com> User-Agent: Mutt/1.8.2 (2017-04-18) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jun 2017 05:39:29 -0000 On Mon, Jun 19, 2017 at 09:15:33AM +0800, Greg Kroah-Hartman wrote: > > +int ser_to_dev(int ser, dev_t *dev_no) > > +{ > > + if (ser < 0 || ser > (255 - 64)) { > > + pr_err("speakup: Invalid ser param. \ > > + Must be between 0 and 191 inclusive.\n"); > > As Andy pointed out, never do this for a C string, it's not doing what > you think it is :) Of course! I am sorry I should address such issues before submitting. Will watch out more carefully next time. > > Worse case, do this like the following: > pr_err("speakup: Invalid ser param." > "Must be between 0 and 191 inclusive.\n"); > > Also note, you are using spaces here in the patch, always run > checkpatch.pl on your patches, so you don't get a grumpy maintainer > telling you to run checkpatch.pl on your patches :) Sure. Thanks for the patience. Okash