Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c00b1b7d authored by roel kluin's avatar roel kluin Committed by Linus Torvalds
Browse files

sm501: unsigned ptr cannot be negative



unsigned ptr cannot be negative

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fd002050
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -159,6 +159,9 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem,
		break;

	case SM501_MEMF_PANEL:
		if (size > inf->fbmem_len)
			return -ENOMEM;

		ptr = inf->fbmem_len - size;
		fbi = inf->fb[HEAD_CRT];

@@ -172,9 +175,6 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem,
		if (fbi && ptr < fbi->fix.smem_len)
			return -ENOMEM;

		if (ptr < 0)
			return -ENOMEM;

		break;

	case SM501_MEMF_CRT: