Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2012 19:55:24 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239530 - head/sys/arm/at91
Message-ID:  <201208211955.q7LJtOO3095789@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Aug 21 19:55:24 2012
New Revision: 239530
URL: http://svn.freebsd.org/changeset/base/239530

Log:
  Make some at91_pcm_xxx() functions NULL safe.

Modified:
  head/sys/arm/at91/at91_pmc.c

Modified: head/sys/arm/at91/at91_pmc.c
==============================================================================
--- head/sys/arm/at91/at91_pmc.c	Tue Aug 21 19:45:48 2012	(r239529)
+++ head/sys/arm/at91/at91_pmc.c	Tue Aug 21 19:55:24 2012	(r239530)
@@ -369,12 +369,15 @@ at91_pmc_clock_ref(const char *name)
 void
 at91_pmc_clock_deref(struct at91_pmc_clock *clk)
 {
-
+	if (clk == NULL)
+		return;
 }
 
 void
 at91_pmc_clock_enable(struct at91_pmc_clock *clk)
 {
+	if (clk == NULL)
+		return;
 
 	/* XXX LOCKING? XXX */
 	if (clk->parent)
@@ -386,6 +389,8 @@ at91_pmc_clock_enable(struct at91_pmc_cl
 void
 at91_pmc_clock_disable(struct at91_pmc_clock *clk)
 {
+	if (clk == NULL)
+		return;
 
 	/* XXX LOCKING? XXX */
 	if (--clk->refcnt == 0 && clk->set_mode)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208211955.q7LJtOO3095789>