kbase_os_mem_map_lock(kctx);
kbase_gpu_vm_lock(kctx);
+ /* MALI_SEC_INTEGRATION */
+#if defined (CONFIG_SOC_EXYNOS8895)
+ if (sset->size > 8*1024*1024) {
+ flush_all_cpu_caches();
+ goto out_unlock;
+ }
+#endif
+
/* find the region where the virtual address is contained */
reg = kbase_region_tracker_find_region_enclosing_address(kctx,
sset->mem_handle.basep.handle);
return -EINVAL;
}
- /* Make sure the terminal type MSB is not null, otherwise it
- * could be confused with a unit.
+ /*
+ * Reject invalid terminal types that would cause issues:
+ *
+ * - The high byte must be non-zero, otherwise it would be
+ * confused with a unit.
+ *
+ * - Bit 15 must be 0, as we use it internally as a terminal
+ * direction flag.
+ *
+ * Other unknown types are accepted.
*/
type = get_unaligned_le16(&buffer[4]);
- if ((type & 0xff00) == 0) {
+ if ((type & 0x7f00) == 0 || (type & 0x8000) != 0) {
uvc_trace(UVC_TRACE_DESCR, "device %d videocontrol "
"interface %d INPUT_TERMINAL %d has invalid "
"type 0x%04x, skipping\n", udev->devnum,
spin_lock_irqsave(&acm->lock, flags);
- if (acm->notify_req) {
- dev_dbg(&cdev->gadget->dev, "acm ttyGS%d serial state %04x\n",
- acm->port_num, acm->serial_state);
- serial_state = cpu_to_le16(acm->serial_state);
- status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE,
+ if (acm->notify->enabled) {
+ if (acm->notify_req) {
+ dev_dbg(&cdev->gadget->dev, "acm ttyGS%d serial state %04x\n",
+ acm->port_num, acm->serial_state);
+ serial_state = cpu_to_le16(acm->serial_state);
+ status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE,
0, &serial_state, sizeof(acm->serial_state));
+ } else {
+ acm->pending = true;
+ status = 0;
+ }
} else {
- acm->pending = true;
- status = 0;
+ status = -EAGAIN;
+ printk(KERN_DEBUG "usb: %s acm function already disabled\n", __func__);
}
spin_unlock_irqrestore(&acm->lock, flags);
return status;
#ifdef CONFIG_USB_DUN_SUPPORT
int acm_notify(void *dev, u16 state)
{
- struct f_acm *acm;
- if (dev) {
- acm = (struct f_acm *)dev;
+ struct f_acm *acm = (struct f_acm *)dev;
+
+ if (acm && acm->notify->enabled) {
acm->serial_state = state;
acm_notify_serial_state(acm);
} else {