X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Flocks.c;h=d7c53392cac12cf5b907d0122e1e504ca7a26f0e;hb=ac7f6b5e44cb0982b98c31fa33298ba73fb5dcfc;hp=b0b41a64e10bd86482b10a7ba44b36613a6d25e8;hpb=0d10e47f9635ecafe5a9dc6e10cb056a87a4daa2;p=linux-2.6 diff --git a/fs/locks.c b/fs/locks.c index b0b41a64e1..d7c53392ca 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1421,8 +1421,9 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) if (!leases_enable) goto out; - error = lease_alloc(filp, arg, &fl); - if (error) + error = -ENOMEM; + fl = locks_alloc_lock(); + if (fl == NULL) goto out; locks_copy_lock(fl, lease); @@ -1430,6 +1431,7 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) locks_insert_lock(before, fl); *flp = fl; + error = 0; out: return error; }