Permalink
Browse files

GT-I9300_JB_Opensource_Update9

  • Loading branch information...
1 parent c614f42 commit 8a4d9a5ce0409d9c9fbc7e4727c7953548d75fdf @gokhanmoral committed Mar 30, 2013
Showing with 8 additions and 5 deletions.
  1. +1 −0 arch/arm/configs/m0_00_defconfig
  2. +7 −5 kernel/sys.c
@@ -1210,6 +1210,7 @@ CONFIG_UID_STAT=y
# CONFIG_2MIC_FM34_WE395 is not set
CONFIG_MUIC_MAX77693_SUPPORT_OTG_AUDIO_DOCK=y
CONFIG_MUIC_MAX77693_SUPPORT_SMART_DOCK=y
+CONFIG_MUIC_MAX77693_SUPPORT_CAR_DOCK=y
# CONFIG_USBHUB_USB3503 is not set
# CONFIG_PN544 is not set
# CONFIG_STMPE811_ADC is not set
View
@@ -1138,15 +1138,16 @@ DECLARE_RWSEM(uts_sem);
* Work around broken programs that cannot handle "Linux 3.0".
* Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
*/
-static int override_release(char __user *release, int len)
+static int override_release(char __user *release, size_t len)
{
int ret = 0;
- char buf[65];
if (current->personality & UNAME26) {
- char *rest = UTS_RELEASE;
+ const char *rest = UTS_RELEASE;
+ char buf[65] = { 0 };
int ndots = 0;
unsigned v;
+ size_t copy;
while (*rest) {
if (*rest == '.' && ++ndots >= 3)
@@ -1156,8 +1157,9 @@ static int override_release(char __user *release, int len)
rest++;
}
v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
- snprintf(buf, len, "2.6.%u%s", v, rest);
- ret = copy_to_user(release, buf, len);
+ copy = min(sizeof(buf), max_t(size_t, 1, len));
+ copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
+ ret = copy_to_user(release, buf, copy + 1);
}
return ret;
}

0 comments on commit 8a4d9a5

Please sign in to comment.