]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drbd: drbd_nla_check_mandatory(): Need to remove the DRBD_GENLA_F_MANDATORY flag...
authorAndreas Gruenbacher <agruen@linbit.com>
Tue, 24 May 2011 12:08:58 +0000 (14:08 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:55:56 +0000 (16:55 +0100)
We need to remove the flag before checking for valid types.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
include/linux/genl_magic_func.h

index 58edd403a3ff8be84aa1c5d4e4ee2aba93b1f509..357f2ad403b1d32a1e9ddd27b7c50ba92d0844bf 100644 (file)
@@ -158,9 +158,9 @@ static inline int drbd_nla_check_mandatory(int maxtype, struct nlattr *nla)
 
        nla_for_each_attr(nla, head, len, rem) {
                if (nla->nla_type & DRBD_GENLA_F_MANDATORY) {
+                       nla->nla_type &= ~DRBD_GENLA_F_MANDATORY;
                        if (nla_type(nla) > maxtype)
                                return -EOPNOTSUPP;
-                       nla->nla_type &= ~DRBD_GENLA_F_MANDATORY;
                }
        }
        return 0;