aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/tty_ldisc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 8a88a7787cfe..fb7329ab2b37 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -176,12 +176,11 @@ static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc)
176 return ERR_CAST(ldops); 176 return ERR_CAST(ldops);
177 } 177 }
178 178
179 ld = kmalloc(sizeof(struct tty_ldisc), GFP_KERNEL); 179 /*
180 if (ld == NULL) { 180 * There is no way to handle allocation failure of only 16 bytes.
181 put_ldops(ldops); 181 * Let's simplify error handling and save more memory.
182 return ERR_PTR(-ENOMEM); 182 */
183 } 183 ld = kmalloc(sizeof(struct tty_ldisc), GFP_KERNEL | __GFP_NOFAIL);
184
185 ld->ops = ldops; 184 ld->ops = ldops;
186 ld->tty = tty; 185 ld->tty = tty;
187 186