Re: [announce] HVCS for inclusion in 2.6 tree

From: Andrew Morton
Date: Thu Jul 22 2004 - 18:25:34 EST


Ryan Arnold <rsa@xxxxxxxxxx> wrote:
>
> +static int hvcs_get_pi(struct hvcs_struct *hvcsd)
> +{
> + /* struct hvcs_partner_info *head_pi = NULL; */
> + struct hvcs_partner_info *pi = NULL;
> + unsigned int unit_address = hvcsd->vdev->unit_address;
> + struct list_head head;
> + unsigned long flags;
> + int retval;
> +
> + spin_lock_irqsave(&hvcs_pi_lock, flags);
> + if (!hvcs_pi_buff) {
> + spin_unlock_irqrestore(&hvcs_pi_lock, flags);
> + return -EFAULT;
> + }
> + retval = hvcs_get_partner_info(unit_address, &head, hvcs_pi_buff);
> + if (retval) {
> + printk(KERN_ERR "HVCS: Failed to fetch partner"
> + " info for vty-server@%x.\n",unit_address);
> + spin_lock_irqsave(&hvcs_pi_lock, flags);

^^ spin_unlock

> + return retval;
> + }
> + spin_unlock_irqrestore(&hvcs_pi_lock, flags);
>

(Just move the spin_unlock() to be prior to the test of retval).

Suggest you review all similar code in the patch for the same copy-n-paste
bug.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/