Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755250AbZJAO6s (ORCPT ); Thu, 1 Oct 2009 10:58:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754036AbZJAO6s (ORCPT ); Thu, 1 Oct 2009 10:58:48 -0400 Received: from smtp.nokia.com ([192.100.122.230]:52385 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753095AbZJAO6r (ORCPT ); Thu, 1 Oct 2009 10:58:47 -0400 Subject: Re: [PATCH 1/1] Kobject: bail early if no new_parent in kobject_move() From: Phil Carmody Reply-To: ext-phil.2.carmody@nokia.com To: ext Greg KH Cc: "linux-kernel@vger.kernel.org" In-Reply-To: <20091001144933.GA4222@suse.de> References: <> <20091001144933.GA4222@suse.de> Content-Type: text/plain Organization: Nokia Oyj Date: Thu, 01 Oct 2009 18:01:50 +0300 Message-Id: <1254409310.32640.459.camel@pcarmody-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Oct 2009 14:58:23.0427 (UTC) FILETIME=[9F5F3930:01CA42A7] X-Nokia-AV: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 920 Lines: 23 On Thu, 2009-10-01 at 16:49 +0200, ext Greg KH wrote: > On Thu, Oct 01, 2009 at 05:50:48PM +0300, Phil Carmody wrote: > > From: Phil Carmody > > > > In the absense of kobj->kset, new_parent would remain NULL. > > NULL-dereference shenanighans then ensues in the subsequent > > sysfs_move_dir(..., new_parent) call. Bail early instead. > > What caller causes this to happen? It was spotted by static code analysis. If there's no such path, then the ``if (kobj->kset)'' condition itself would be unnecessary. Phil -- "They weren't designed to run on a computer, they were designed to run on a Powerpoint slide projector." -- Peter Gutmann -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/