vserver 1.9.3
[linux-2.6.git] / drivers / w1 / w1_family.c
index 9b8443c..6a62d2a 100644 (file)
 spinlock_t w1_flock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(w1_families);
 
+static int w1_check_family(struct w1_family *f)
+{
+       if (!f->fops->rname || !f->fops->rbin || !f->fops->rval || !f->fops->rvalname)
+               return -EINVAL;
+
+       return 0;
+}
+
 int w1_register_family(struct w1_family *newf)
 {
        struct list_head *ent, *n;
        struct w1_family *f;
        int ret = 0;
 
+       if (w1_check_family(newf))
+               return -EINVAL;
+
        spin_lock(&w1_flock);
        list_for_each_safe(ent, n, &w1_families) {
                f = list_entry(ent, struct w1_family, family_entry);