Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753341AbdFSFj0 (ORCPT ); Mon, 19 Jun 2017 01:39:26 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35727 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487AbdFSFjZ (ORCPT ); Mon, 19 Jun 2017 01:39:25 -0400 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) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 843 Lines: 25 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