X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Flocks.c;fp=fs%2Flocks.c;h=7189834098a1b4ef1c1886de4d050e1f05ab7eef;hb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;hp=7ec121cb37f5879665f583b5e93a194c1db6c1d7;hpb=1db395853d4f30d6120458bd279ede1f882a8525;p=linux-2.6.git diff --git a/fs/locks.c b/fs/locks.c index 7ec121cb3..718983409 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1409,8 +1409,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); @@ -1418,6 +1419,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; }