From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934435AbbGHIrP (ORCPT ); Wed, 8 Jul 2015 04:47:15 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:44722 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933341AbbGHIrL (ORCPT ); Wed, 8 Jul 2015 04:47:11 -0400 Date: Wed, 8 Jul 2015 11:45:59 +0300 From: Dan Carpenter To: green@linuxhacker.ru Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Linux Kernel Mailing List Subject: Re: [PATCH 18/20] staging/lustre/libcfs: get rid of debugfs/lnet/debug_mb Message-ID: <20150708084202.GN4341@mwanda> References: <1436201338-14263-1-git-send-email-green@linuxhacker.ru> <1436201338-14263-19-git-send-email-green@linuxhacker.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436201338-14263-19-git-send-email-green@linuxhacker.ru> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 06, 2015 at 12:48:56PM -0400, green@linuxhacker.ru wrote: > +static int libcfs_param_debug_mb_set(const char *val, > + const struct kernel_param *kp) > +{ > + int rc; > + unsigned num; > + > + rc = kstrtouint(val, 0, &num); > + if (rc == -EINVAL) > + return -EINVAL; Presumably, this is root only so using num uninitialized is not an information leak. > + > + if (!*((unsigned int *)kp->arg)) { > + *((unsigned int *)kp->arg) = num; > + return 0; > + } > + > + rc = cfs_trace_set_debug_mb(num); > + > + if (!rc) > + *((unsigned int *)kp->arg) = cfs_trace_get_debug_mb(); > + > + return rc; > +} regards, dan carpenter