X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fpnp%2Finterface.c;h=ac9fcd499f3f0cb9912dee2e1400e6f1f519aad3;hb=f4fbfb0dda5577075a049eec7fb7ad38abca1912;hp=9d8b415eca79ba729e0104d1a4af1e7f185123ef;hpb=78cc3b78c4208d28e7f4ecded82e238224ed4d1c;p=linux-2.6 diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index 9d8b415eca..ac9fcd499f 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c @@ -461,8 +461,19 @@ static DEVICE_ATTR(id,S_IRUGO,pnp_show_current_ids,NULL); int pnp_interface_attach_device(struct pnp_dev *dev) { - device_create_file(&dev->dev,&dev_attr_options); - device_create_file(&dev->dev,&dev_attr_resources); - device_create_file(&dev->dev,&dev_attr_id); + int rc = device_create_file(&dev->dev,&dev_attr_options); + if (rc) goto err; + rc = device_create_file(&dev->dev,&dev_attr_resources); + if (rc) goto err_opt; + rc = device_create_file(&dev->dev,&dev_attr_id); + if (rc) goto err_res; + return 0; + +err_res: + device_remove_file(&dev->dev,&dev_attr_resources); +err_opt: + device_remove_file(&dev->dev,&dev_attr_options); +err: + return rc; }