Re: [PATCH_v2 10/11] android/hid: Add virtual unplug implemention in daemon

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

 



Hi Ravi,

On Fri, Nov 08, 2013, Ravi kumar Veeramally wrote:
> +	fd = g_io_channel_unix_get_fd(dev->ctrl_io);
> +
> +	if (write(fd, &hdr, sizeof(hdr)) < 0) {
> +		error("error while virtual unplug command");
> +		return HAL_STATUS_FAILED;
> +	}
> +
> +	/* Wait either channels to HUP */
> +	if (dev->intr_io)
> +		g_io_channel_shutdown(dev->intr_io, TRUE, NULL);
> +
> +	if (dev->ctrl_io)
> +		g_io_channel_shutdown(dev->ctrl_io, TRUE, NULL);

This looks a bit suspicious. First you try to get the fd from ctrl_io
without checking if it's NULL and then later you have an explicit check
for whether it is NULL or not. Is there some check missing earlier in
the function?

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux