From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 18:20:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAEE31065682; Wed, 22 Oct 2008 18:20:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99B8D8FC25; Wed, 22 Oct 2008 18:20:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MIKj0s035540; Wed, 22 Oct 2008 18:20:45 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MIKjWe035539; Wed, 22 Oct 2008 18:20:45 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810221820.m9MIKjWe035539@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 22 Oct 2008 18:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184173 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 18:20:45 -0000 Author: marcel Date: Wed Oct 22 18:20:45 2008 New Revision: 184173 URL: http://svn.freebsd.org/changeset/base/184173 Log: Trivially avoid a null pointer dereference when drivers don't set the rman description. While drivers should set it, a kernel panic is not the right behaviour when faced without one. Modified: head/sys/kern/subr_rman.c Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Wed Oct 22 18:07:37 2008 (r184172) +++ head/sys/kern/subr_rman.c Wed Oct 22 18:20:45 2008 (r184173) @@ -866,7 +866,8 @@ sysctl_rman(SYSCTL_HANDLER_ARGS) if (res_idx == -1) { bzero(&urm, sizeof(urm)); urm.rm_handle = (uintptr_t)rm; - strlcpy(urm.rm_descr, rm->rm_descr, RM_TEXTLEN); + if (rm->rm_descr != NULL) + strlcpy(urm.rm_descr, rm->rm_descr, RM_TEXTLEN); urm.rm_start = rm->rm_start; urm.rm_size = rm->rm_end - rm->rm_start + 1; urm.rm_type = rm->rm_type;