aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console/bitblit.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/console/bitblit.c')
-rw-r--r--drivers/video/console/bitblit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c
index b1d435940eb12..b28a4b0e395e6 100644
--- a/drivers/video/console/bitblit.c
+++ b/drivers/video/console/bitblit.c
@@ -199,7 +199,10 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
count -= cnt;
}
- if (buf)
+ /* buf is always NULL except when in monochrome mode, so in this case
+ it's a gain to check buf against NULL even though kfree() handles
+ NULL pointers just fine */
+ if (unlikely(buf))
kfree(buf);
}
@@ -273,8 +276,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info,
dst = kmalloc(w * vc->vc_font.height, GFP_ATOMIC);
if (!dst)
return;
- if (ops->cursor_data)
- kfree(ops->cursor_data);
+ kfree(ops->cursor_data);
ops->cursor_data = dst;
update_attr(dst, src, attribute, vc);
src = dst;
@@ -321,8 +323,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info,
if (!mask)
return;
- if (ops->cursor_state.mask)
- kfree(ops->cursor_state.mask);
+ kfree(ops->cursor_state.mask);
ops->cursor_state.mask = mask;
p->cursor_shape = vc->vc_cursor_type;