Re: [PATCH] staging: dgap: make dgap_found_board() return a brd pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 20, 2014 at 02:19:58PM +0900, Daeseok Youn wrote:
> -	rc = dgap_found_board(pdev, ent->driver_data, dgap_numboards);
> -	if (rc)
> +	brd = dgap_found_board(pdev, ent->driver_data, dgap_numboards);
> +	if (IS_ERR(brd))
>  		return rc;

		return ERR_PTR(brd);


>  
> -	brd = dgap_board[dgap_numboards++];
>  	rc = dgap_firmware_load(pdev, ent->driver_data, brd);
>  	if (rc)
>  		goto cleanup_brd;
> @@ -617,6 +617,8 @@ static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	brd->state = BOARD_READY;
>  	brd->dpastatus = BD_RUNNING;
>  
> +	dgap_board[dgap_numboards++] = brd;

You need to update the error handling of this function to remove the
reference do dgap_board[] as well.

> +
>  	return 0;
>  

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux