--- orig/sleep.c
+++ mod/sleep.c
@@ -36,6 +36,9 @@
       typeof(y) _y = (y); \
       _x < _y ? _x : _y; })
 
+#define error(fmt, arg...) printk (KERN_ERR "%s: " fmt "\n", \
+				   THIS_MODULE->name, ## arg)
+
 
 MODULE_AUTHOR ("Elmar Hoffmann <elho@elho.net>");
 MODULE_LICENSE ("GPL");
@@ -87,11 +90,13 @@
 
   proc_sleep = create_proc_entry ("sleep", S_IFREG | S_IRUGO | S_IWUGO,
 				  NULL);
-  if (proc_sleep)
+  if (proc_sleep == NULL)
     {
-      proc_sleep->owner = THIS_MODULE;
-      proc_sleep->write_proc = sleep_write_proc;
+      error ("failed to create proc entry");
+      return -ENOMEM;
     }
+  proc_sleep->owner = THIS_MODULE;
+  proc_sleep->write_proc = sleep_write_proc;
 
   return 0;
 }
