[PATCH] USB: fix show_modalias() function due to attribute change
[safe/jmp/linux-2.6] / drivers / s390 / scsi / zfcp_aux.c
index 52fc1d7..e17b4d5 100644 (file)
@@ -218,13 +218,20 @@ zfcp_in_els_dbf_event(struct zfcp_adapter *adapter, const char *text,
  * Parse "device=..." parameter string.
  */
 static int __init
-zfcp_device_setup(char *str)
+zfcp_device_setup(char *devstr)
 {
-       char *tmp;
+       char *tmp, *str;
+       size_t len;
 
-       if (!str)
+       if (!devstr)
                return 0;
 
+       len = strlen(devstr) + 1;
+       str = (char *) kmalloc(len, GFP_KERNEL);
+       if (!str)
+               goto err_out;
+       memcpy(str, devstr, len);
+
        tmp = strchr(str, ',');
        if (!tmp)
                goto err_out;
@@ -241,10 +248,12 @@ zfcp_device_setup(char *str)
        zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0);
        if (*tmp != '\0')
                goto err_out;
+       kfree(str);
        return 1;
 
  err_out:
        ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str);
+       kfree(str);
        return 0;
 }
 
@@ -520,7 +529,7 @@ zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
 
  out:
        if (fsf_req != NULL)
-               zfcp_fsf_req_cleanup(fsf_req);
+               zfcp_fsf_req_free(fsf_req);
 
        if ((adapter != NULL) && (retval != -ENXIO))
                zfcp_adapter_put(adapter);
@@ -1149,7 +1158,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
        INIT_LIST_HEAD(&adapter->port_remove_lh);
 
        /* initialize list of fsf requests */
-       rwlock_init(&adapter->fsf_req_list_lock);
+       spin_lock_init(&adapter->fsf_req_list_lock);
        INIT_LIST_HEAD(&adapter->fsf_req_list_head);
 
        /* initialize abort lock */
@@ -1234,9 +1243,9 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
        zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
        dev_set_drvdata(&adapter->ccw_device->dev, NULL);
        /* sanity check: no pending FSF requests */
-       read_lock_irqsave(&adapter->fsf_req_list_lock, flags);
+       spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
        retval = !list_empty(&adapter->fsf_req_list_head);
-       read_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
+       spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
        if (retval) {
                ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, "
                                "%i requests outstanding\n",
@@ -1753,7 +1762,10 @@ static void zfcp_ns_gid_pn_handler(unsigned long data)
        ct_iu_req = zfcp_sg_to_address(ct->req);
        ct_iu_resp = zfcp_sg_to_address(ct->resp);
 
-       if ((ct->status != 0) || zfcp_check_ct_response(&ct_iu_resp->header)) {
+       if (ct->status != 0)
+               goto failed;
+
+       if (zfcp_check_ct_response(&ct_iu_resp->header)) {
                /* FIXME: do we need some specific erp entry points */
                atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status);
                goto failed;