selection.c (98817a84ff1c755c347ac633ff017a623a631fad) selection.c (44c413d9a51752056d606bf6f312003ac1740fab)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * This module exports the functions:
4 *
5 * 'int set_selection_user(struct tiocl_selection __user *,
6 * struct tty_struct *)'
7 * 'int set_selection_kernel(struct tiocl_selection *, struct tty_struct *)'
8 * 'void clear_selection(void)'

--- 179 unchanged lines hidden (view full) ---

188static int vc_selection_store_chars(struct vc_data *vc, bool unicode)
189{
190 char *bp, *obp;
191 unsigned int i;
192
193 /* Allocate a new buffer before freeing the old one ... */
194 /* chars can take up to 4 bytes with unicode */
195 bp = kmalloc_array((vc_sel.end - vc_sel.start) / 2 + 1, unicode ? 4 : 1,
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * This module exports the functions:
4 *
5 * 'int set_selection_user(struct tiocl_selection __user *,
6 * struct tty_struct *)'
7 * 'int set_selection_kernel(struct tiocl_selection *, struct tty_struct *)'
8 * 'void clear_selection(void)'

--- 179 unchanged lines hidden (view full) ---

188static int vc_selection_store_chars(struct vc_data *vc, bool unicode)
189{
190 char *bp, *obp;
191 unsigned int i;
192
193 /* Allocate a new buffer before freeing the old one ... */
194 /* chars can take up to 4 bytes with unicode */
195 bp = kmalloc_array((vc_sel.end - vc_sel.start) / 2 + 1, unicode ? 4 : 1,
196 GFP_KERNEL);
196 GFP_KERNEL | __GFP_NOWARN);
197 if (!bp) {
198 printk(KERN_WARNING "selection: kmalloc() failed\n");
199 clear_selection();
200 return -ENOMEM;
201 }
202 kfree(vc_sel.buffer);
203 vc_sel.buffer = bp;
204

--- 216 unchanged lines hidden ---
197 if (!bp) {
198 printk(KERN_WARNING "selection: kmalloc() failed\n");
199 clear_selection();
200 return -ENOMEM;
201 }
202 kfree(vc_sel.buffer);
203 vc_sel.buffer = bp;
204

--- 216 unchanged lines hidden ---