/* WARNING: Removing unreachable block (ram,0x0008f9a8) */
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
char * RtmpOSNetDevCreate(void)
{
char cVar1;
int iVar2;
size_t sVar3;
size_t sVar4;
char *pcVar5;
char *pcVar6;
char *pcVar7;
uint uVar8;
int in_a3;
char *in_stack_00000014;
char *local_50;
undefined4 local_4c;
char acStack_48 [16];
char local_38 [16];
local_50 = (char *)0x0;
local_4c = 0;
iVar2 = RtmpOSNetDevAlloc(&local_50,0) //possible issue identified - semgrep
if (iVar2 == 0) {
iVar2 = RtmpOSNetDevOpsAlloc(&local_4c) //possible issue identified - semgrep
if (iVar2 == 0) {
if (2 < RTDebugLevel) {
printk("Allocate net device ops success!\n");
}
pcVar5 = local_50;
*(undefined4 *)(local_50 + 0xb4) = local_4c;
sVar3 = strlen(in_stack_00000014);
if (0xf < (int)sVar3) {
printk("<4>/home/eric/release/dir600b5/progs.priv/rt2860v2/build/rt2860v2_ap/../rt2860v2/os/linux/rt_linux.c:%d assert (prefixLen < IFNAMSIZ)failed\n"
,0x4f2);
}
while (pcVar7 = local_38, in_a3 < 0x20) {
memset(acStack_48,0,0x10) //possible issue identified - semgrep
memset(pcVar7,0,0x10) //possible issue identified - semgrep
sVar4 = sVar3;
pcVar6 = in_stack_00000014;
while (sVar4 != 0) {
cVar1 = *pcVar6;
sVar4 = sVar4 - 1 //possible issue identified - semgrep
*pcVar7 = cVar1;
pcVar7 = pcVar7 + 1;
if (cVar1 == '\0') break;
pcVar6 = pcVar6 + 1;
}
sprintf(acStack_48,"%d") //possible issue identified - semgrep
sVar4 = strlen(acStack_48);
pcVar7 = local_38;
if (0xf < (int)(sVar4 + sVar3)) {
printk("<4>/home/eric/release/dir600b5/progs.priv/rt2860v2/build/rt2860v2_ap/../rt2860v2/os/linux/rt_linux.c:%d assert ((slotNameLen + prefixLen) < IFNAMSIZ)failed\n"
,0x501);
}
strcat(pcVar7,acStack_48) //possible issue identified - semgrep
iVar2 = dev_get_by_name(&init_net,pcVar7);
if (iVar2 == 0) {
do {
cVar1 = *pcVar7;
pcVar7 = pcVar7 + 1;
*pcVar5 = cVar1;
pcVar5 = pcVar5 + 1;
} while (cVar1 != '\0');
if (RTDebugLevel < 3) {
return local_50;
}
printk("The name of the new %s interface is %s...\n",in_stack_00000014,local_50);
return local_50;
}
if (_kill_pid << 0xf < 0) {
*(int *)(iVar2 + 0x1c8) = *(int *)(iVar2 + 0x1c8) + -1;
in_a3 = in_a3 + 1;
}
else {
uVar8 = Status & 1;
*(int *)(iVar2 + 0x1c8) = *(int *)(iVar2 + 0x1c8) + -1;
Status = Status & 0xfffffffe;
if (uVar8 != 0) {
Status = Status | 1;
}
in_a3 = in_a3 + 1;
}
}
if (RTDebugLevel != 0) {
printk("Cannot request DevName with preifx(%s) and in range(0~32) as suffix from OS!\n",
in_stack_00000014);
}
if (RTDebugLevel != 0) {
printk("Assign interface name (%s with suffix 0~32) failed...\n",in_stack_00000014);
}
}
else if (2 < RTDebugLevel) {
printk("Allocate net device ops fail!\n");
}
RtmpOSNetDevFree(local_50);
}
else if (RTDebugLevel != 0) {
printk("Allocate network device fail (%s)...\n",in_stack_00000014);
}
return (char *)0x0;
}