On Thu, Apr 05, 2007 at 07:41:02PM -0400, J. Bruce Fields wrote:
> + if (block->b_fl)
> + kfree(block->b_fl);
kfree(NULL) is fine.
> +static void
> +nlmsvc_update_deferred_block(struct nlm_block *block, struct file_lock *conf,
> + int result)
> +{
> + block->b_flags |= B_GOT_CALLBACK;
> + if (result == 0)
> + block->b_granted = 1;
> + else
> + block->b_flags |= B_TOO_LATE;
> + if (conf) {
> + block->b_fl = kzalloc(sizeof(struct file_lock), GFP_KERNEL);
> + if (block->b_fl)
> + locks_copy_lock(block->b_fl, conf);
> + }
> +}
Shouldn't there be a way to propagate errors back to the caller when
the kzalloc fails?
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html