Thread (7 messages) flat view 7 messages, 3 authors, 2021-08-05

Re: [PATCH v3 1/2] tty: hvc: pass DMA capable memory to put_chars()

From: Jiri Slaby <jirislaby@kernel.org>
Date: 2021-08-05 07:58:25
Also in: lkml

Hi,

On 04. 08. 21, 4:54, Xianting Tian wrote:
quoted hunk ↗ jump to hunk
@@ -933,6 +949,16 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,
  	hp->outbuf_size = outbuf_size;
  	hp->outbuf = &((char *)hp)[ALIGN(sizeof(*hp), sizeof(long))];
  
+	/*
+	 * hvc_con_outbuf is guaranteed to be aligned at least to the
+	 * size(N_OUTBUF) by kmalloc().
+	 */
+	hp->hvc_con_outbuf = kzalloc(N_OUTBUF, GFP_KERNEL);
+	if (!hp->hvc_con_outbuf)
+		return ERR_PTR(-ENOMEM);
This leaks hp, right?

BTW your 2 patches are still not threaded, that is hard to follow.
+
+	spin_lock_init(&hp->hvc_con_lock);
+
  	tty_port_init(&hp->port);
  	hp->port.ops = &hvc_port_ops;
  
thanks,
-- 
js
suse labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help