Skip to content

Commit

Permalink
GT-I9300_JB_Opensource_Update9
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhanmoral committed Apr 1, 2013
1 parent c614f42 commit 8a4d9a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions arch/arm/configs/m0_00_defconfig
Expand Up @@ -1210,6 +1210,7 @@ CONFIG_UID_STAT=y
# CONFIG_2MIC_FM34_WE395 is not set # CONFIG_2MIC_FM34_WE395 is not set
CONFIG_MUIC_MAX77693_SUPPORT_OTG_AUDIO_DOCK=y CONFIG_MUIC_MAX77693_SUPPORT_OTG_AUDIO_DOCK=y
CONFIG_MUIC_MAX77693_SUPPORT_SMART_DOCK=y CONFIG_MUIC_MAX77693_SUPPORT_SMART_DOCK=y
CONFIG_MUIC_MAX77693_SUPPORT_CAR_DOCK=y
# CONFIG_USBHUB_USB3503 is not set # CONFIG_USBHUB_USB3503 is not set
# CONFIG_PN544 is not set # CONFIG_PN544 is not set
# CONFIG_STMPE811_ADC is not set # CONFIG_STMPE811_ADC is not set
Expand Down
12 changes: 7 additions & 5 deletions kernel/sys.c
Expand Up @@ -1138,15 +1138,16 @@ DECLARE_RWSEM(uts_sem);
* Work around broken programs that cannot handle "Linux 3.0". * 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 * 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; int ret = 0;
char buf[65];


if (current->personality & UNAME26) { if (current->personality & UNAME26) {
char *rest = UTS_RELEASE; const char *rest = UTS_RELEASE;
char buf[65] = { 0 };
int ndots = 0; int ndots = 0;
unsigned v; unsigned v;
size_t copy;


while (*rest) { while (*rest) {
if (*rest == '.' && ++ndots >= 3) if (*rest == '.' && ++ndots >= 3)
Expand All @@ -1156,8 +1157,9 @@ static int override_release(char __user *release, int len)
rest++; rest++;
} }
v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40; v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
snprintf(buf, len, "2.6.%u%s", v, rest); copy = min(sizeof(buf), max_t(size_t, 1, len));
ret = copy_to_user(release, buf, len); copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
ret = copy_to_user(release, buf, copy + 1);
} }
return ret; return ret;
} }
Expand Down

0 comments on commit 8a4d9a5

Please sign in to comment.