ARM: S3C24XX: arch/arm/plat-s3c24xx: Move dereference after NULL test
[linux-2.6-block.git] / arch / arm / plat-s3c24xx / dma.c
index 196b19123653a244bc9da318a25c8b6fc5977d01..f046f8c51084c6628bb437319c67f1d8f79dfba6 100644 (file)
@@ -208,14 +208,14 @@ s3c2410_dma_loadbuffer(struct s3c2410_dma_chan *chan,
 {
        unsigned long reload;
 
-       pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n",
-                buf, (unsigned long)buf->data, buf->size);
-
        if (buf == NULL) {
                dmawarn("buffer is NULL\n");
                return -EINVAL;
        }
 
+       pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n",
+                buf, (unsigned long)buf->data, buf->size);
+
        /* check the state of the channel before we do anything */
 
        if (chan->load_state == S3C2410_DMALOAD_1LOADED) {