X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fpnp%2Finterface.c;h=ac9fcd499f3f0cb9912dee2e1400e6f1f519aad3;hb=5b2a08262a8c952fef008154933953f083ca5766;hp=9d8b415eca79ba729e0104d1a4af1e7f185123ef;hpb=6e315544a61ac0fa21369e54e50a947ab899966e;p=powerpc.git 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; }