How to mark suspicious code?
Hi all!
How can I mark suspicious code, if I can not fix it?
Hi all!
How can I mark suspicious code, if I can not fix it?
Quoted 3 lines · Ivan Safonov
Hi all!
How can I mark suspicious code, if I can not fix it?
What do you mean by "mark"?
And also what do you mean by "suspicious"?
And why can't you fix it?
we need more details.
thanks,
greg k-h
Quoted 5 lines · Greg KH
Quoted 3 lines · Ivan Safonov
Hi all!
How can I mark suspicious code, if I can not fix it?
What do you mean by "mark"?
Leave a comment in the code, write a letter to maintainer, etc. What to do?
Quoted 1 line
And also what do you mean by "suspicious"?
This is the wrong code that needs to be corrected.
Quoted 7 lines
And why can't you fix it?
we need more details.
thanks,
greg k-h
Correction of the code will change the behavior of the program. For example:
while (1) {
if (down_interruptible(&pcmdpriv->cmd_queue_sema))
break;
if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
...
break;
}
_next:
if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
...
break;
}
...
if (!pcmd)
continue;
...
goto _next;
}
...
up(&pcmdpriv->terminate_cmdthread_sema);Here down_interruptible(sem) in the loop but up(sem) only after the loop. Corrected example below:
if (down_interruptible(&pcmdpriv->cmd_queue_sema)) {
...
}
while (1) {
if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
...
break;
}
_next:
if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
...
break;
}
...
if (!pcmd)
continue;
...
goto _next;
}
...
}
up(&pcmdpriv->terminate_cmdthread_sema);I can not test the corrected code on the device.
Quoted 68 lines · Ivan Safonov
Quoted 5 lines · Greg KH
Quoted 3 lines · Ivan Safonov
Hi all!
How can I mark suspicious code, if I can not fix it?
What do you mean by "mark"?
Leave a comment in the code, write a letter to maintainer, etc. What to do?
Quoted 1 line
And also what do you mean by "suspicious"?
This is the wrong code that needs to be corrected.
Quoted 7 lines
And why can't you fix it?
we need more details.
thanks,
greg k-h
Correction of the code will change the behavior of the program. For example:
while (1) { if (down_interruptible(&pcmdpriv->cmd_queue_sema)) break; if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } _next: if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } ... if (!pcmd) continue; ... goto _next; } ... up(&pcmdpriv->terminate_cmdthread_sema);Here
down_interruptible(sem)in the loop but up(sem) only after the loop. Corrected example below:if (down_interruptible(&pcmdpriv->cmd_queue_sema)) { ... } while (1) { if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } _next: if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } ... if (!pcmd) continue; ... goto _next; } ... } up(&pcmdpriv->terminate_cmdthread_sema);
Quoted 1 line
I can not test the corrected code on the device.
Make a patch, send it to the people and mailing list that get_maintainer.pl shows and the developers will take it from there.
Quoted 43 lines · Greg KH
Quoted 42 lines · Ivan Safonov
Quoted 5 lines · Greg KH
Quoted 3 lines · Ivan Safonov
Hi all!
How can I mark suspicious code, if I can not fix it?
What do you mean by "mark"?
Leave a comment in the code, write a letter to maintainer, etc. What to do?
Quoted 1 line
And also what do you mean by "suspicious"?
This is the wrong code that needs to be corrected.
Quoted 7 lines
And why can't you fix it?
we need more details.
thanks,
greg k-h
Correction of the code will change the behavior of the program. For example:
while (1) { if (down_interruptible(&pcmdpriv->cmd_queue_sema)) break; if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } _next: if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } ... if (!pcmd) continue; ... goto _next; } ... up(&pcmdpriv->terminate_cmdthread_sema);
Quoted 2 lines
Quoted 2 lines
Here
down_interruptible(sem)in the loop but up(sem) only after the loop. Corrected example below:
don't get it - what does
down_interruptible(&pcmdpriv->cmd_queue_sema)
have to do with:
up(&pcmdpriv->terminate_cmdthread_sema)
its a different sem.
thx!
hofrat
Quoted 69 lines · Greg KH
Quoted 68 lines · Ivan Safonov
Quoted 5 lines · Greg KH
Quoted 3 lines · Ivan Safonov
Hi all!
How can I mark suspicious code, if I can not fix it?
What do you mean by "mark"?
Leave a comment in the code, write a letter to maintainer, etc. What to do?
Quoted 1 line
And also what do you mean by "suspicious"?
This is the wrong code that needs to be corrected.
Quoted 7 lines
And why can't you fix it?
we need more details.
thanks,
greg k-h
Correction of the code will change the behavior of the program. For example:
while (1) { if (down_interruptible(&pcmdpriv->cmd_queue_sema)) break; if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } _next: if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } ... if (!pcmd) continue; ... goto _next; } ... up(&pcmdpriv->terminate_cmdthread_sema);Here
down_interruptible(sem)in the loop but up(sem) only after the loop. Corrected example below:if (down_interruptible(&pcmdpriv->cmd_queue_sema)) { ... } while (1) { if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } _next: if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { ... break; } ... if (!pcmd) continue; ... goto _next; } ... } up(&pcmdpriv->terminate_cmdthread_sema);
Quoted 4 lines
Quoted 1 line
I can not test the corrected code on the device.
Make a patch, send it to the people and mailing list that get_maintainer.pl shows and the developers will take it from there.
Thanks!