lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121207110043.GO22569@mwanda>
Date:	Fri, 7 Dec 2012 14:00:43 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Rolf Eike Beer <eike-kernel@...tec.de>
Cc:	Nagalakshmi Nandigama <Nagalakshmi.Nandigama@....com>,
	Sreekanth Reddy <Sreekanth.Reddy@....com>, support@....com,
	"James E.J. Bottomley" <JBottomley@...allels.com>,
	DL-MPTFusionLinux@....com, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] [SCSI] mpt3sas: cut and paste bug storing trigger mpi

On Fri, Dec 07, 2012 at 09:41:56AM +0100, Rolf Eike Beer wrote:
> > 	memset(&ioc->diag_trigger_mpi, 0,
> >-	    sizeof(struct SL_WH_EVENT_TRIGGERS_T));
> >+	    sizeof(struct SL_WH_MPI_TRIGGERS_T));
> > 	memcpy(&ioc->diag_trigger_mpi, buf, sz);
> > 	if (ioc->diag_trigger_mpi.ValidEntries > NUM_VALID_ENTRIES)
> > 		ioc->diag_trigger_mpi.ValidEntries = NUM_VALID_ENTRIES;
> 
> Then just use sizeof(ioc->diag_trigger_mpi), then it's irrelevant
> how that type is ever called.
> 

Yeah, that's the way I would have prefered to write this as well.
It took me a while to verify that the intent here was not to clear
only part of the struct.  Using sizeof(variable_name) instead of
sizeof(type) is more readable.

But then you get into the thing where the line before uses
sizeof(type)...

Oh well, I've sent both styles and the maintainer can choose.  :)

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ