From: Wolfgang Denk Date: Mon, 09 Aug 2010 01:04:05 +0200 Subject: [U-Boot] [PATCH] flash_protect: check for NULL flash info In-Reply-To: <1280375103-8392-1-git-send-email-vapier@gentoo.org> References: <1280375103-8392-1-git-send-email-vapier@gentoo.org> Message-ID: <20100808230405.CDF781536EF@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mike Frysinger, In message <1280375103-8392-1-git-send-email-vapier@gentoo.org> you wrote: > If a flash is unable to be detected, and then someone calls flash_protect > on it (like the common code does in flash_init), the flash_protect logic > will dereference a NULL pointer. > > Since flash_protect already does sanity checking on the info structs, add > a NULL pointer check in there. > > Signed-off-by: Mike Frysinger > --- > common/flash.c | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Hello! I'm from outer space, and I've made myself look like a signa- ture. While you are reading this, I'm having sex with your eyes. I know it feels good to you, because you're smiling. I'm very horny, so send me to someone else when you've had enough. Thanks! Sincerely, A Stranger in a Strange Land