Loading drivers/soc/qcom/msm_glink_pkt.c +17 −5 Original line number Original line Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * * This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -664,8 +664,15 @@ ssize_t glink_pkt_read(struct file *file, spin_unlock_irqrestore(&devp->pkt_list_lock, flags); spin_unlock_irqrestore(&devp->pkt_list_lock, flags); ret = copy_to_user(buf, pkt->data, pkt->size); ret = copy_to_user(buf, pkt->data, pkt->size); if (WARN_ON(ret != 0)) if (ret) { return ret; GLINK_PKT_ERR( "%s copy_to_user failed ret[%d] on dev id:%d size %zu\n", __func__, ret, devp->i, pkt->size); spin_lock_irqsave(&devp->pkt_list_lock, flags); list_add_tail(&pkt->list, &devp->pkt_list); spin_unlock_irqrestore(&devp->pkt_list_lock, flags); return -EFAULT; } ret = pkt->size; ret = pkt->size; glink_rx_done(devp->handle, pkt->data, false); glink_rx_done(devp->handle, pkt->data, false); Loading Loading @@ -739,8 +746,13 @@ ssize_t glink_pkt_write(struct file *file, } } ret = copy_from_user(data, buf, count); ret = copy_from_user(data, buf, count); if (WARN_ON(ret != 0)) if (ret) { return ret; GLINK_PKT_ERR( "%s copy_from_user failed ret[%d] on dev id:%d size %zu\n", __func__, ret, devp->i, count); kfree(data); return -EFAULT; } ret = glink_tx(devp->handle, data, data, count, GLINK_TX_REQ_INTENT); ret = glink_tx(devp->handle, data, data, count, GLINK_TX_REQ_INTENT); if (ret) { if (ret) { Loading Loading
drivers/soc/qcom/msm_glink_pkt.c +17 −5 Original line number Original line Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * * This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -664,8 +664,15 @@ ssize_t glink_pkt_read(struct file *file, spin_unlock_irqrestore(&devp->pkt_list_lock, flags); spin_unlock_irqrestore(&devp->pkt_list_lock, flags); ret = copy_to_user(buf, pkt->data, pkt->size); ret = copy_to_user(buf, pkt->data, pkt->size); if (WARN_ON(ret != 0)) if (ret) { return ret; GLINK_PKT_ERR( "%s copy_to_user failed ret[%d] on dev id:%d size %zu\n", __func__, ret, devp->i, pkt->size); spin_lock_irqsave(&devp->pkt_list_lock, flags); list_add_tail(&pkt->list, &devp->pkt_list); spin_unlock_irqrestore(&devp->pkt_list_lock, flags); return -EFAULT; } ret = pkt->size; ret = pkt->size; glink_rx_done(devp->handle, pkt->data, false); glink_rx_done(devp->handle, pkt->data, false); Loading Loading @@ -739,8 +746,13 @@ ssize_t glink_pkt_write(struct file *file, } } ret = copy_from_user(data, buf, count); ret = copy_from_user(data, buf, count); if (WARN_ON(ret != 0)) if (ret) { return ret; GLINK_PKT_ERR( "%s copy_from_user failed ret[%d] on dev id:%d size %zu\n", __func__, ret, devp->i, count); kfree(data); return -EFAULT; } ret = glink_tx(devp->handle, data, data, count, GLINK_TX_REQ_INTENT); ret = glink_tx(devp->handle, data, data, count, GLINK_TX_REQ_INTENT); if (ret) { if (ret) { Loading