From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 945B2B7B5C for ; Thu, 6 Aug 2009 16:48:45 +1000 (EST) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 64042DDD0B for ; Thu, 6 Aug 2009 16:48:43 +1000 (EST) Subject: Re: [PATCH] powerpc/perfctr: Check oprofile_cpu_type for NULL before using it From: Benjamin Herrenschmidt To: David Woodhouse In-Reply-To: <1249540910.23206.67.camel@macbook.infradead.org> References: <1249531356.18245.73.camel@pasglop> <1249540910.23206.67.camel@macbook.infradead.org> Content-Type: text/plain Date: Thu, 06 Aug 2009 16:48:19 +1000 Message-Id: <1249541299.18245.74.camel@pasglop> Mime-Version: 1.0 Cc: linuxppc-dev list , Ingo Molnar , Paul Mackerras List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 2009-08-06 at 07:41 +0100, David Woodhouse wrote: > On Thu, 2009-08-06 at 14:02 +1000, Benjamin Herrenschmidt wrote: > > If the current CPU doesn't support performance counters, > > cur_cpu_spec->oprofile_cpu_type can be NULL. The current > > perfctr modules don't test for that case and would thus > > crash. > > It can't actually be NULL on a 64-bit CPU; all 64-bit CPUs in the table > have ->oprofile_cpu_type set. .... today :-) > Of course, adding the check probably makes sense anyway. Yup, better safe. Cheers, Ben.